ucdb

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseModel

type BaseModel struct {
	ID uuid.UUID `db:"id" json:"id" yaml:"id"`

	Created time.Time `db:"created" json:"created" yaml:"created"`
	Updated time.Time `db:"updated" json:"updated" yaml:"updated"`

	Deleted time.Time `db:"deleted" json:"deleted" yaml:"deleted"`
}

BaseModel underlies (almost) all of our models

func NewBase

func NewBase() BaseModel

NewBase initializes a new UCBase

func NewBaseWithID

func NewBaseWithID(id uuid.UUID) BaseModel

NewBaseWithID initializes a new BaseModel with a specific ID

func (BaseModel) Alive

func (b BaseModel) Alive() bool

Alive returns true if the object is "alive" and false if it's been deleted

func (BaseModel) Validate

func (b BaseModel) Validate() error

Validate implements Validateable

type UserBaseModel

type UserBaseModel struct {
	BaseModel

	UserID uuid.UUID `db:"user_id" json:"user_id" yaml:"user_id"`
}

UserBaseModel is a user-related underlying model for many of our models eg. in IDP

func NewUserBase

func NewUserBase(userID uuid.UUID) UserBaseModel

NewUserBase initializes a new user base model

func (UserBaseModel) Validate

func (u UserBaseModel) Validate() error

Validate implements Validateable

Jump to

Keyboard shortcuts

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