data

package
v0.0.0-...-56d0da8 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const NAME_REGEX = `[a-zA-Z][0-9a-zA-Z .,'-]*`

Variables

This section is empty.

Functions

func ToJSON

func ToJSON(v interface{}, w io.Writer)

Types

type Profile

type Profile struct {
	Email      string    `json:"Email" validate:"required,email" `
	FirstName  string    `json:"Firstname" validate:"required,name"`
	LastName   string    `json:"Lastname" validate:"required,name"`
	CreatedOn  time.Time `json:"-"`
	ModifiedOn time.Time `json:"-"`
	DeletedOn  time.Time `json:"-"`
}

func FromJSON

func FromJSON(r io.ReadCloser) (*Profile, error)

type ProfileDB

type ProfileDB struct {
	Logger hclog.Logger
	DB     Profiles
}

func NewProfileDB

func NewProfileDB(l hclog.Logger) *ProfileDB

func (*ProfileDB) AddProfile

func (p *ProfileDB) AddProfile(np *Profile)

func (*ProfileDB) GetAllProfiles

func (p *ProfileDB) GetAllProfiles() Profiles

func (*ProfileDB) GetProfile

func (p *ProfileDB) GetProfile(pi string) (*Profile, error)

type ProfileStore

type ProfileStore interface {
	AddProfile(p *Profile)
	DeleteProfile(p string)
	UpdateProfile(p *Profile)
	GetProfile(pi string) (*Profile, error)
}

type Profiles

type Profiles []*Profile

type Validation

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

func NewValidator

func NewValidator() *Validation

func (*Validation) Validate

func (v *Validation) Validate(i interface{}) error

Jump to

Keyboard shortcuts

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