models

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2019 License: MIT Imports: 4 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Namespace string

Namespace puts all tables names under a common namespace. This is useful if you want to use the same database for several services and don't want table names to collide.

Functions

func IsNotFoundError

func IsNotFoundError(err error) bool

IsNotFoundError returns whether an error represents a "not found" error.

Types

type Instance

type Instance struct {
	ID string `json:"id" bson:"_id,omitempty"`
	// Netlify UUID
	UUID string `json:"uuid,omitempty" bson:"uuid,omitempty"`

	// force usage of text column type
	RawBaseConfig string              `json:"-" bson:"-" gorm:"size:65535"`
	BaseConfig    *conf.Configuration `json:"config"`

	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	DeletedAt *time.Time `json:"deleted_at"`
}

func (*Instance) AfterFind

func (i *Instance) AfterFind() error

AfterFind database callback.

func (*Instance) BeforeSave

func (i *Instance) BeforeSave() error

BeforeSave database callback.

func (*Instance) Config

func (i *Instance) Config() (*conf.Configuration, error)

Config loads the the base configuration values with defaults.

func (*Instance) TableName

func (i *Instance) TableName() string

TableName returns the table name used for the Instance model

type InstanceNotFoundError

type InstanceNotFoundError struct{}

InstanceNotFoundError represents when an instance is not found.

func (InstanceNotFoundError) Error

func (e InstanceNotFoundError) Error() string

type Pagination

type Pagination struct {
	Page    uint64
	PerPage uint64
	Count   uint64
}

func (*Pagination) Offset

func (p *Pagination) Offset() uint64

type RefreshTokenNotFoundError

type RefreshTokenNotFoundError struct{}

RefreshTokenNotFoundError represents when a refresh token is not found.

func (RefreshTokenNotFoundError) Error

type SortDirection

type SortDirection string
const Ascending SortDirection = "asc"
const Descending SortDirection = "desc"

type SortField

type SortField struct {
	Name string
	Dir  SortDirection
}

type SortParams

type SortParams struct {
	Fields []SortField
}

type UserNotFoundError

type UserNotFoundError struct{}

UserNotFoundError represents when a user is not found.

func (UserNotFoundError) Error

func (e UserNotFoundError) Error() string

Jump to

Keyboard shortcuts

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