field

package
v0.0.0-...-2a6d28c Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultHashIterations = 1

Variables

View Source
var ErrInvalidStatus = errors.New("Invalid status value provided.")

Functions

This section is empty.

Types

type Created

type Created struct {
	By *model.Modifier
	At time.Time
}

Created field which can be embedded into high level models.

func NewCreated

func NewCreated(by *model.Modifier, at time.Time) *Created

NewCreated creates a new Created.

type Hash

type Hash struct {
	Value string
}

Hash field which can be embedded into high level models. It represents some random unique value.

func NewHash

func NewHash(value string) *Hash

NewHash creates a new Hash from the string.

func NewRandomHash

func NewRandomHash(iterations int) *Hash

NewHash creates a new Hash. A length of Hash.Value depends on the iterations number. If iteration is equal to 1 resulting Hash.Value will be 36. If it is 2, resulting Hash.Value will be 72, end so on.

type Status

type Status struct {
	Value  string
	Config []string
}

Status field which can be embedded into high level models.

func NewStatus

func NewStatus(value string, config []string) (*Status, error)

NewStatus creates a new Status.

func (*Status) Change

func (s *Status) Change(status string) error

Change set new underlying value of status or return error if that value is not valid.

func (*Status) IsValid

func (s *Status) IsValid(status string) bool

IsValid checks if valid value is provided as a Status value.

type Updated

type Updated struct {
	By *model.Modifier
	At time.Time
}

Updated field which can be embedded into high level models.

func NewUpdated

func NewUpdated(by *model.Modifier, at time.Time) *Updated

NewUpdated creates a new Updated.

Jump to

Keyboard shortcuts

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