Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
brianvoe committed Dec 13, 2023
2 parents cf00293 + da8ba32 commit e4f5beb
Show file tree
Hide file tree
Showing 20 changed files with 270 additions and 147 deletions.
18 changes: 9 additions & 9 deletions address.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,15 @@ func addAddressLookup() {
Category: "address",
Description: "Random set of address info",
Example: `{
"address": "364 Unionsville, Norfolk, Ohio 99536",
"street": "364 Unionsville",
"city": "Norfolk",
"state": "Ohio",
"zip": "99536",
"country": "Lesotho",
"latitude": 88.792592,
"longitude": 174.504681
}`,
"address": "364 Unionsville, Norfolk, Ohio 99536",
"street": "364 Unionsville",
"city": "Norfolk",
"state": "Ohio",
"zip": "99536",
"country": "Lesotho",
"latitude": 88.792592,
"longitude": 174.504681
}`,
Output: "map[string]any",
ContentType: "application/json",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand Down
8 changes: 4 additions & 4 deletions book.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ func addBookLookup() {
Category: "book",
Description: "Random Book data set",
Example: `{
"title": "Anna Karenina",
"author": "Toni Morrison",
"genre": "Thriller"
}`,
"title": "Anna Karenina",
"author": "Toni Morrison",
"genre": "Thriller"
}`,
Output: "map[string]string",
ContentType: "application/json",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand Down
14 changes: 7 additions & 7 deletions car.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ func addCarLookup() {
Category: "car",
Description: "Random car set of data",
Example: `{
"type": "Passenger car mini",
"fuel": "Gasoline",
"transmission": "Automatic",
"brand": "Fiat",
"model": "Freestyle Fwd",
"year": 1991
}`,
"type": "Passenger car mini",
"fuel": "Gasoline",
"transmission": "Automatic",
"brand": "Fiat",
"model": "Freestyle Fwd",
"year": 1991
}`,
Output: "map[string]any",
ContentType: "application/json",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand Down
10 changes: 5 additions & 5 deletions company.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ func addCompanyLookup() {
Category: "company",
Description: "Random job data set",
Example: `{
"company": "ClearHealthCosts",
"title": "Agent",
"descriptor": "Future",
"level": "Tactics"
}`,
"company": "ClearHealthCosts",
"title": "Agent",
"descriptor": "Future",
"level": "Tactics"
}`,
Output: "map[string]string",
ContentType: "application/json",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand Down
8 changes: 3 additions & 5 deletions csv.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,9 @@ func addFileCSVLookup() {
Display: "CSV",
Category: "file",
Description: "Generates array of rows in csv format",
Example: `
id,first_name,last_name,password
1,Markus,Moen,Dc0VYXjkWABx
2,Osborne,Hilll,XPJ9OVNbs5lm
`,
Example: `id,first_name,last_name,password
1,Markus,Moen,Dc0VYXjkWABx
2,Osborne,Hilll,XPJ9OVNbs5lm`,
Output: "[]byte",
ContentType: "text/csv",
Params: []Param{
Expand Down
2 changes: 1 addition & 1 deletion finance.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func addFinanceLookup() {
Display: "ISIN",
Category: "finance",
Description: "Random ISIN",
Example: "",
Example: "CVLRQCZBXQ97",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
return isin(r), nil
Expand Down
18 changes: 11 additions & 7 deletions generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,12 +500,10 @@ func addGenerateLookup() {
Display: "Fixed Width",
Category: "generate",
Description: "Generates fixed width output",
Example: `
Name Email Password Age
Markus Moen sylvanmraz@murphy.net 6VlvH6qqXc7g 13
Alayna Wuckert santinostanton@carroll.biz g7sLrS0gEwLO 46
Lura Lockman zacherykuhic@feil.name S8gV7Z64KlHG 12
`,
Example: `Name Email Password Age
Markus Moen sylvanmraz@murphy.net 6VlvH6qqXc7g 13
Alayna Wuckert santinostanton@carroll.biz g7sLrS0gEwLO 46
Lura Lockman zacherykuhic@feil.name S8gV7Z64KlHG 12`,
Output: "[]byte",
ContentType: "text/plain",
Params: []Param{
Expand Down Expand Up @@ -575,7 +573,13 @@ func addGenerateLookup() {
Display: "Map",
Category: "generate",
Description: "Random map of generated data",
Example: `map[consult:respond context:9285735]`,
Example: `{
"software": 7518355,
"that": ["despite", "pack", "whereas", "recently", "there", "anyone", "time", "read"],
"use": 683598,
"whom": "innovate",
"yourselves": 1987784
}`,
Output: "map[string]any",
ContentType: "application/json",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand Down
8 changes: 6 additions & 2 deletions hipster.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,12 @@ func addHipsterLookup() {
Display: "Hipster Paragraph",
Category: "hipster",
Description: "Random hipster paragraph",
Example: "Microdosing roof chia echo pickled meditation cold-pressed raw denim fingerstache normcore sriracha pork belly. Wolf try-hard pop-up blog tilde hashtag health butcher waistcoat paleo portland vinegar. Microdosing sartorial blue bottle slow-carb freegan five dollar toast you probably haven't heard of them asymmetrical chia farm-to-table narwhal banjo. Gluten-free blog authentic literally synth vinyl meh ethical health fixie banh mi Yuccie. Try-hard drinking squid seitan cray VHS echo chillwave hammock kombucha food truck sustainable.<br />Pug bushwick hella tote bag cliche direct trade waistcoat yr waistcoat knausgaard pour-over master. Pitchfork jean shorts franzen flexitarian distillery hella meggings austin knausgaard crucifix wolf heirloom. Crucifix food truck you probably haven't heard of them trust fund fixie gentrify pitchfork stumptown mlkshk umami chambray blue bottle. 3 wolf moon swag +1 biodiesel knausgaard semiotics taxidermy meh artisan hoodie +1 blue bottle. Fashion axe forage mixtape Thundercats pork belly whatever 90's beard selfies chambray cred mlkshk.<br />Shabby chic typewriter VHS readymade lo-fi bitters PBR&B gentrify lomo raw denim freegan put a bird on it. Raw denim cliche dreamcatcher pug fixie park trust fund migas fingerstache sriracha +1 mustache. Tilde shoreditch kickstarter franzen dreamcatcher green juice mustache neutra polaroid stumptown organic schlitz. Flexitarian ramps chicharrones kogi lo-fi mustache tilde forage street church-key williamsburg taxidermy. Chia mustache plaid mumblecore squid slow-carb disrupt Thundercats goth shoreditch master direct trade.",
Output: "string",
Example: `Microdosing roof chia echo pickled meditation cold-pressed raw denim fingerstache normcore sriracha pork belly. Wolf try-hard pop-up blog tilde hashtag health butcher waistcoat paleo portland vinegar. Microdosing sartorial blue bottle slow-carb freegan five dollar toast you probably haven't heard of them asymmetrical chia farm-to-table narwhal banjo. Gluten-free blog authentic literally synth vinyl meh ethical health fixie banh mi Yuccie. Try-hard drinking squid seitan cray VHS echo chillwave hammock kombucha food truck sustainable.
Pug bushwick hella tote bag cliche direct trade waistcoat yr waistcoat knausgaard pour-over master. Pitchfork jean shorts franzen flexitarian distillery hella meggings austin knausgaard crucifix wolf heirloom. Crucifix food truck you probably haven't heard of them trust fund fixie gentrify pitchfork stumptown mlkshk umami chambray blue bottle. 3 wolf moon swag +1 biodiesel knausgaard semiotics taxidermy meh artisan hoodie +1 blue bottle. Fashion axe forage mixtape Thundercats pork belly whatever 90's beard selfies chambray cred mlkshk.
Shabby chic typewriter VHS readymade lo-fi bitters PBR&B gentrify lomo raw denim freegan put a bird on it. Raw denim cliche dreamcatcher pug fixie park trust fund migas fingerstache sriracha +1 mustache. Tilde shoreditch kickstarter franzen dreamcatcher green juice mustache neutra polaroid stumptown organic schlitz. Flexitarian ramps chicharrones kogi lo-fi mustache tilde forage street church-key williamsburg taxidermy. Chia mustache plaid mumblecore squid slow-carb disrupt Thundercats goth shoreditch master direct trade.`,
Output: "string",
Params: []Param{
{Field: "paragraphcount", Display: "Paragraph Count", Type: "int", Default: "2", Description: "Number of paragraphs"},
{Field: "sentencecount", Display: "Sentence Count", Type: "int", Default: "2", Description: "Number of sentences in a paragraph"},
Expand Down
5 changes: 4 additions & 1 deletion html.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ func addHtmlLookup() {
Display: "Image SVG",
Category: "html",
Description: "Random svg and ",
Example: `<svg width="369" height="289"><rect fill="#4f2958" /><polygon points="382,87 418,212 415,110" fill="#fffbb7" /></svg>`,
Example: `<svg width="369" height="289">
<rect fill="#4f2958" />
<polygon points="382,87 418,212 415,110" fill="#fffbb7" />
</svg>`,
Output: "string",
ContentType: "image/svg+xml",
Params: []Param{
Expand Down
3 changes: 3 additions & 0 deletions lookup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ func TestLookupCheckFields(t *testing.T) {
if info.Category == "" {
t.Fatalf("%s is missing a category", field)
}
if info.Example == "" {
t.Fatalf("%s is missing an example", field)
}
if info.Output == "" {
t.Fatalf("%s is misssing output", field)
}
Expand Down
8 changes: 6 additions & 2 deletions lorem.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@ func addLoremLookup() {
Display: "Lorem Ipsum Paragraph",
Category: "word",
Description: "Random lorem ipsum paragraph",
Example: "Quia quae repellat consequatur quidem nisi quo qui voluptatum accusantium quisquam amet. Quas et ut non dolorem ipsam aut enim assumenda mollitia harum ut. Dicta similique veniam nulla voluptas at excepturi non ad maxime at non. Eaque hic repellat praesentium voluptatem qui consequuntur dolor iusto autem velit aut. Fugit tempore exercitationem harum consequatur voluptatum modi minima aut eaque et et.<br />Aut ea voluptatem dignissimos expedita odit tempore quod aut beatae ipsam iste. Minus voluptatibus dolorem maiores eius sed nihil vel enim odio voluptatem accusamus. Natus quibusdam temporibus tenetur cumque sint necessitatibus dolorem ex ducimus iusto ex. Voluptatem neque dicta explicabo officiis et ducimus sit ut ut praesentium pariatur. Illum molestias nisi at dolore ut voluptatem accusantium et fugiat et ut.<br />Explicabo incidunt reprehenderit non quia dignissimos recusandae vitae soluta quia et quia. Aut veniam voluptas consequatur placeat sapiente non eveniet voluptatibus magni velit eum. Nobis vel repellendus sed est qui autem laudantium quidem quam ullam consequatur. Aut iusto ut commodi similique quae voluptatem atque qui fugiat eum aut. Quis distinctio consequatur voluptatem vel aliquid aut laborum facere officiis iure tempora.",
Output: "string",
Example: `Quia quae repellat consequatur quidem nisi quo qui voluptatum accusantium quisquam amet. Quas et ut non dolorem ipsam aut enim assumenda mollitia harum ut. Dicta similique veniam nulla voluptas at excepturi non ad maxime at non. Eaque hic repellat praesentium voluptatem qui consequuntur dolor iusto autem velit aut. Fugit tempore exercitationem harum consequatur voluptatum modi minima aut eaque et et.
Aut ea voluptatem dignissimos expedita odit tempore quod aut beatae ipsam iste. Minus voluptatibus dolorem maiores eius sed nihil vel enim odio voluptatem accusamus. Natus quibusdam temporibus tenetur cumque sint necessitatibus dolorem ex ducimus iusto ex. Voluptatem neque dicta explicabo officiis et ducimus sit ut ut praesentium pariatur. Illum molestias nisi at dolore ut voluptatem accusantium et fugiat et ut.
Explicabo incidunt reprehenderit non quia dignissimos recusandae vitae soluta quia et quia. Aut veniam voluptas consequatur placeat sapiente non eveniet voluptatibus magni velit eum. Nobis vel repellendus sed est qui autem laudantium quidem quam ullam consequatur. Aut iusto ut commodi similique quae voluptatem atque qui fugiat eum aut. Quis distinctio consequatur voluptatem vel aliquid aut laborum facere officiis iure tempora.`,
Output: "string",
Params: []Param{
{Field: "paragraphcount", Display: "Paragraph Count", Type: "int", Default: "2", Description: "Number of paragraphs"},
{Field: "sentencecount", Display: "Sentence Count", Type: "int", Default: "2", Description: "Number of sentences in a paragraph"},
Expand Down
6 changes: 3 additions & 3 deletions movie.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ func addMovieLookup() {
Category: "movie",
Description: "Random Movie data set",
Example: `{
"name": "Psycho",
"genre": "Mystery"
}`,
"name": "Psycho",
"genre": "Mystery"
}`,
Output: "map[string]string",
ContentType: "application/json",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand Down
16 changes: 8 additions & 8 deletions payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ func addPaymentLookup() {
Category: "payment",
Description: "Random currency data set",
Example: `{
"short": "IQD",
"long": "Iraq Dinar"
}`,
"short": "IQD",
"long": "Iraq Dinar"
}`,
Output: "map[string]string",
ContentType: "application/json",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand Down Expand Up @@ -307,11 +307,11 @@ func addPaymentLookup() {
Category: "payment",
Description: "Random credit card data set",
Example: `{
"type": "UnionPay",
"number": "4364599489953698",
"exp": "02/24",
"cvv": "300"
}`,
"type": "UnionPay",
"number": "4364599489953698",
"exp": "02/24",
"cvv": "300"
}`,
Output: "map[string]any",
ContentType: "application/json",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand Down
96 changes: 48 additions & 48 deletions person.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,39 +211,39 @@ func addPersonLookup() {
Category: "person",
Description: "Random set of person info",
Example: `{
"first_name": "Markus",
"last_name": "Moen",
"gender": "male",
"ssn": "275413589",
"image": "https://picsum.photos/208/500",
"hobby": "Lacrosse",
"job": {
"company": "Intermap Technologies",
"title": "Developer",
"descriptor": "Direct",
"level": "Paradigm"
},
"address": {
"address": "369 North Cornerbury, Miami, North Dakota 24259",
"street": "369 North Cornerbury",
"city": "Miami",
"state": "North Dakota",
"zip": "24259",
"country": "Ghana",
"latitude": -6.662595,
"longitude": 23.921575
},
"contact": {
"phone": "3023202027",
"email": "lamarkoelpin@heaney.biz"
},
"credit_card": {
"type": "Maestro",
"number": "39800889982276",
"exp": "01/29",
"cvv": "932"
}
}`,
"first_name": "Markus",
"last_name": "Moen",
"gender": "male",
"ssn": "275413589",
"image": "https://picsum.photos/208/500",
"hobby": "Lacrosse",
"job": {
"company": "Intermap Technologies",
"title": "Developer",
"descriptor": "Direct",
"level": "Paradigm"
},
"address": {
"address": "369 North Cornerbury, Miami, North Dakota 24259",
"street": "369 North Cornerbury",
"city": "Miami",
"state": "North Dakota",
"zip": "24259",
"country": "Ghana",
"latitude": -6.662595,
"longitude": 23.921575
},
"contact": {
"phone": "3023202027",
"email": "lamarkoelpin@heaney.biz"
},
"credit_card": {
"type": "Maestro",
"number": "39800889982276",
"exp": "01/29",
"cvv": "932"
}
}`,
Output: "map[string]any",
ContentType: "application/json",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand Down Expand Up @@ -388,21 +388,21 @@ func addPersonLookup() {
Category: "person",
Description: "Randomly split people into teams",
Example: `{
"Team 1": [
"Justin",
"Connor",
"Jeff"
],
"Team 2": [
"Sharon",
"Fabian",
"Billy"
],
"Team 3": [
"Steve",
"Robert"
]
}`,
"Team 1": [
"Justin",
"Connor",
"Jeff"
],
"Team 2": [
"Sharon",
"Fabian",
"Billy"
],
"Team 3": [
"Steve",
"Robert"
]
}`,
Output: "map[string][]string",
ContentType: "application/json",
Params: []Param{
Expand Down
30 changes: 15 additions & 15 deletions product.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,24 +160,24 @@ func productUPC(r *rand.Rand) string {

func addProductLookup() {
AddFuncLookup("product", Info{
Display: "Product Info",
Display: "Product",
Category: "product",
Description: "Random product info",
Example: `{
"name": "olive copper monitor",
"description": "Backwards caused quarterly without week it hungry thing someone him regularly. Whomever this revolt hence from his timing as quantity us these yours.",
"categories": [
"clothing",
"tools and hardware"
],
"price": 7.61,
"features": [
"ultra-lightweight"
],
"color": "navy",
"material": "brass",
"upc": "012780949980"
}`,
"name": "olive copper monitor",
"description": "Backwards caused quarterly without week it hungry thing someone him regularly. Whomever this revolt hence from his timing as quantity us these yours.",
"categories": [
"clothing",
"tools and hardware"
],
"price": 7.61,
"features": [
"ultra-lightweight"
],
"color": "navy",
"material": "brass",
"upc": "012780949980"
}`,
Output: "map[string]any",
ContentType: "application/json",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand Down
10 changes: 5 additions & 5 deletions sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ func addDatabaseSQLLookup() {
AddFuncLookup("sql", Info{
Display: "SQL",
Category: "database",
Description: "Generates an object or an array of objects in json format",
Description: "Generates a SQL multi insert statement",
Example: `INSERT INTO people
(id, first_name, price, age, created_at)
VALUES
(1, 'Markus', 804.92, 21, '1937-01-30 07:58:01'),
(2, 'Santino', 235.13, 40, '1964-07-07 22:25:40');`,
(id, first_name, price, age, created_at)
VALUES
(1, 'Markus', 804.92, 21, '1937-01-30 07:58:01'),
(2, 'Santino', 235.13, 40, '1964-07-07 22:25:40');`,
Output: "string",
ContentType: "application/sql",
Params: []Param{
Expand Down
Loading

0 comments on commit e4f5beb

Please sign in to comment.