model

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAccountModelFieldCreatedAtInvalidValue = scope_error.New(
	"Account model field CreatedAt invalid value")

Error: Account model field CreatedAt invalid value.

View Source
var ErrAccountModelFieldLoginInvalidValue = scope_error.New(
	"Account model field Login invalid value")

Error: Account model field Login invalid value.

View Source
var ErrAccountModelFieldNameInvalidValue = scope_error.New(
	"Account model field Name invalid value")

Error: Account model field Name invalid value.

View Source
var ErrAccountModelFieldNameMustHaveLenGreaterThan3 = errors.New(

	"must have len greater than 3") // name generated by user provided error text

Error: Account model field name validator: must have len greater than 3.

View Source
var ErrAccountModelFieldRevInvalidValue = scope_error.New(
	"Account model field Rev invalid value")

Error: Account model field Rev invalid value.

View Source
var ErrAccountModelFieldSomeExternalUuidInvalidValue = scope_error.New(
	"Account model field SomeExternalUuid invalid value")

Error: Account model field SomeExternalUuid invalid value.

Functions

func ValidateAccountModelFieldCreatedAt

func ValidateAccountModelFieldCreatedAt(val time.Time) error

ValidateAccountModelFieldCreatedAt validates model field CreatedAt value.

Raises ErrAccountModelFieldValidationError with cause ErrAccountModelFieldCreatedAtInvalidValue.

func ValidateAccountModelFieldLogin

func ValidateAccountModelFieldLogin(val string) error

ValidateAccountModelFieldLogin validates model field Login value.

Raises ErrAccountModelFieldValidationError with cause ErrAccountModelFieldLoginInvalidValue.

func ValidateAccountModelFieldName

func ValidateAccountModelFieldName(val string) error

ValidateAccountModelFieldName validates model field Name value.

Raises ErrAccountModelFieldValidationError with cause ErrAccountModelFieldNameInvalidValue.

func ValidateAccountModelFieldRev

func ValidateAccountModelFieldRev(val uuid.UUID) error

ValidateAccountModelFieldRev validates model field Rev value.

Raises ErrAccountModelFieldValidationError with cause ErrAccountModelFieldRevInvalidValue.

func ValidateAccountModelFieldSomeExternalUuid

func ValidateAccountModelFieldSomeExternalUuid(val uuid.UUID) error

ValidateAccountModelFieldSomeExternalUuid validates model field SomeExternalUuid value.

Raises ErrAccountModelFieldValidationError with cause ErrAccountModelFieldSomeExternalUuidInvalidValue.

Types

type Account

type Account struct {
	Login string
	Name  string
	// Value expected to be hashed.
	Password string
	// Used for soft-delete.
	IsDeleted        bool
	Rev              uuid.UUID
	SomeExternalUuid uuid.UUID
	Color            uint8
	MyByte           int8
	Binary           []byte
	CreatedAt        time.Time
	// contains filtered or unexported fields
}

func AccountWithDefaults

func AccountWithDefaults() *Account

AccountWithDefaults constructs model Account with default values defined in schema.

Example:

// construct a new model
myModel := AccountWithDefaults()

// set public fields directly
myModel.SomePublicField = 4221

// or via setter (if generated)
myModel.SetName("Bob")

func (*Account) GetId

func (m *Account) GetId() int64

GetId gets field id value.

Generated due to schema field marked with Getter().

Note: getter can help to satisfy some interface(s).

func (*Account) GetIsDeleted

func (m *Account) GetIsDeleted() bool

GetIsDeleted gets field IsDeleted value.

Generated due to schema field marked with Getter().

Note: getter can help to satisfy some interface(s).

func (*Account) GetLogin

func (m *Account) GetLogin() string

GetLogin gets field Login value.

Generated due to schema field marked with Getter().

Note: getter can help to satisfy some interface(s).

func (*Account) GetName

func (m *Account) GetName() string

GetName gets field Name value.

Generated due to schema field marked with Getter().

Note: getter can help to satisfy some interface(s).

func (*Account) SetIsDeleted

func (m *Account) SetIsDeleted(val bool)

SetIsDeleted sets field IsDeleted value.

Generated due to schema field marked with Setter().

Note: setter can help to satisfy some interface(s).

func (*Account) SetLogin

func (m *Account) SetLogin(val string)

SetLogin sets field Login value.

Generated due to schema field marked with Setter().

Note: setter can help to satisfy some interface(s).

func (*Account) SetName

func (m *Account) SetName(val string)

SetName sets field Name value.

Generated due to schema field marked with Setter().

Note: setter can help to satisfy some interface(s).

func (*Account) String

func (m *Account) String() string

func (*Account) Validate

func (m *Account) Validate() error

Validate validates model by validators specified in schema.

Returns nil if no validators are defined.

Jump to

Keyboard shortcuts

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