document

package
v0.0.0-...-c3a3033 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package document provides the document Types and a quick New for Documentation instances

Index

Constants

View Source
const BrazilContext = "brazil"

BrazilContext refers to documents that are valid in Brazil

Variables

This section is empty.

Functions

This section is empty.

Types

type Cpf

type Cpf struct {
	ID      string
	Context string
}

Cpf provides a brazilian Fiscal Id document

func (Cpf) Generate

func (d Cpf) Generate() Document

Generate creates a fake document

type DocTypes

type DocTypes map[string]reflect.Type

DocTypes Holds a map of string values for each Document type for easier usage. Use the method New(docType string) to get a fake document

func (DocTypes) New

func (register DocTypes) New(name string) (interface{}, error)

New receives the document string and resolve it's instance based on the DocTypes map

func (DocTypes) Set

func (register DocTypes) Set(name string, i interface{})

Set register a string to the Type of i

type Document

type Document interface {
	Generate() Document
}

Document provides methods for generating a fake document

Jump to

Keyboard shortcuts

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