identities

package
v0.0.0-...-38282b8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2017 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllFields []string

AllFields exports a []string with all the fields set

Functions

func MainModule

func MainModule(args map[string]interface{}, out io.Writer) (err error)

MainModule gets the arguments from CLI and launches the appropriate functions

func MarshalCSV

func MarshalCSV(people []Person, out io.Writer) (err error)

MarshalCSV prints a marshaled CSV

func SetFilter

func SetFilter(newFields []string) error

SetFilter sets a filter for the fields to be printed. Supported values are: Nome Cognome Gender PaeseDiNascita ProvinciaDiNascita Indirizzo NumeroDiTelefono DataDiNascita CodiceFiscale PartitaIva ComunePartitaIva Documento Patente CartaDiCredito Iban Username Password

Types

type CartaCredito

type CartaCredito struct {
	Number  string
	Cvv     string
	Issuer  string
	ExpDate string
}

CartaCredito exports the number, CVV, Issuer and expiry date of a credit card

func (*CartaCredito) String

func (cc *CartaCredito) String() string

type Credentials

type Credentials struct {
	Username string
	Password string
}

Credentials exports username and password

type DateFormat

type DateFormat int

DateFormat exports the format of the date. Can be 1,2 or anything else. 1 (us format) is MM/DD/YYYY 2 (ja format) is YYYY/MM/DD anything else is formatted in the european style (default) DD/MM/YYYY

var LocalizDate DateFormat

LocalizDate is a variable containing the format to use. Set this variable to change the way dates are formatted. See "DateFormat" for more.

func NewDateFormat

func NewDateFormat(fmt string) DateFormat

NewDateFormat sets DateFormat as an int from a passed string

func (DateFormat) Format

func (d DateFormat) Format() string

Format returns the date formatted as the DateFormat variable is set

type DrivingLicense

type DrivingLicense struct {
	Number  string
	Issuer  string
	ExpDate string
}

DrivingLicense exports the number, issuer and the expiration date

func (*DrivingLicense) String

func (drv *DrivingLicense) String() string

type Iban

type Iban struct {
	BankName string
	Iban     string
	// contains filtered or unexported fields
}

Iban represents an IBAN object

func (*Iban) String

func (i *Iban) String() string

Gives a string representation of the Iban struct

type Person

type Person struct {
	// contains filtered or unexported fields
}

Person represents a person object. It must be initialized by the generator.

func NewPerson

func NewPerson(minage, maxage int) *Person

NewPerson generates a new identity

func RandomPeople

func RandomPeople(minage, maxage int, count int) (people []Person, err error)

RandomPeople generates 'count' people with the same restriction of age

func (*Person) Address

func (p *Person) Address() string

Address returns a person's address and sets the location for the partita iva field.

func (*Person) BirthDate

func (p *Person) BirthDate() string

BirthDate is a person birth date formatted using the globally specified format

func (*Person) BirthDistrict

func (p *Person) BirthDistrict() string

BirthDistrict is the name and label of the city the person was birth in

func (*Person) BirthTown

func (p *Person) BirthTown() string

BirthTown is a person birth town

func (*Person) CartaCredito

func (p *Person) CartaCredito() *CartaCredito

CartaCredito returns a valid CartaCredito object with credit card number, cvv, issuer and expiration date.

func (*Person) CodiceFiscale

func (p *Person) CodiceFiscale() (cf string)

CodiceFiscale generates a valid italian codice fiscale

func (*Person) Credentials

func (p *Person) Credentials() *Credentials

Credentials returns fictitious credentials for an identity. The username is correlated at the person's name and year of birth.

func (*Person) DrivingLicense

func (p *Person) DrivingLicense() *DrivingLicense

DrivingLicense returns a Italian driving license number

func (*Person) FirstName

func (p *Person) FirstName() string

FirstName is a person first name

func (*Person) Gender

func (p *Person) Gender() string

Gender is the gender of a person in Italian

func (*Person) IBAN

func (p *Person) IBAN() *Iban

IBAN returns an Italian valid IBAN with random bank details.

func (*Person) ID

func (p *Person) ID() string

ID is the identity card number

func (*Person) LastName

func (p *Person) LastName() string

LastName is a person last name

func (Person) MarshalCSV

func (p Person) MarshalCSV() []string

MarshalCSV returns a []string that can be passed to an encoding/csv.Writer.Write() call

func (*Person) MarshalJSON

func (p *Person) MarshalJSON() (b []byte, err error)

MarshalJSON is the implementation of encoding/json.Marshaler

func (*Person) MarshalXML

func (p *Person) MarshalXML(e *xml.Encoder, start xml.StartElement) (err error)

MarshalXML is the implementation of encoding/xml.Marshaler

func (*Person) PartitaIva

func (p *Person) PartitaIva() (pi string, county string)

PartitaIva returns a valid partita iva number and place of issue.

func (*Person) Phone

func (p *Person) Phone() string

Phone is the phone number (Without the +39 italian prefix)

func (Person) String

func (p Person) String() string

String representation, the human readable serialization of a Person object

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL