Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/malisit/kolpa
A fake data generator written in and for Go
https://github.com/malisit/kolpa
datetime fake-content fake-data faker-library go golang random-generation user-agent
Last synced: about 1 month ago
JSON representation
A fake data generator written in and for Go
- Host: GitHub
- URL: https://github.com/malisit/kolpa
- Owner: malisit
- License: mit
- Created: 2017-05-25T04:45:38.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-10-24T19:35:27.000Z (about 4 years ago)
- Last Synced: 2024-11-02T06:47:27.263Z (about 2 months ago)
- Topics: datetime, fake-content, fake-data, faker-library, go, golang, random-generation, user-agent
- Language: Go
- Size: 88.9 KB
- Stars: 651
- Watchers: 11
- Forks: 27
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-golang-repositories - kolpa
README
# kolpa [![Build Status](https://travis-ci.org/malisit/kolpa.svg?branch=master)](https://travis-ci.org/malisit/kolpa) [![Godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/malisit/kolpa) [![license](http://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://raw.githubusercontent.com/malisit/kolpa/master/LICENSE)
*kolpa* is a fake data generator written in and for Go.
It's capable of generating fake data for following instances for now,
- Name
- Address
- Phone Number
- Email Address
- Gender
- Payment Card
- Lorem Ipsum Text
- Color
- Datetime
- User Agent## Installation
run ```go get github.com/malisit/kolpa``` on your command line.## Usage
``` go
package mainimport (
"fmt"
"github.com/malisit/kolpa"
"time"
)func main() {
k := kolpa.C() // Initiate kolpa
fmt.Println(k.FirstName()) // Prints John
fmt.Println(k.Address()) // Prints 729 Richmond Springs Suite 949, Luisborough, VT 85700-5554
fmt.Println(k.UserAgent()) // Prints Mozilla/5.0 (compatible; MSIE 5.0; Windows 98; Win 9x 4.90; Trident/4.0)
fmt.Println(k.Color()) // Prints Lime #00FF00
fmt.Println(k.DateTimeAfter(time.Date(2015, 1, 0, 0, 0, 0, 0, time.UTC))) // Prints 2015-09-08 15:34:29 +0300 EEST
fmt.Println(k.Email()) // Prints [email protected]
fmt.Println(k.Phone()) // Prints +55-44-63311072
fmt.Println(k.Gender()) // Prints male
fmt.Println(k.PaymentCard()) // Prints 4083453410931987
fmt.Println(k.LoremSentence()) // Prints "Provident nobis nostrum blanditiis voluptatem animi rerum harum."}
```
List of all possible functions can be seen on godoc.You can set language when initiating *kolpa*.
``` go
k := kolpa.C("tr_TR")
```Language can be setted afterwards as well.
``` go
k.SetLanguage("tr_TR")
```