models

package
v0.0.0-...-5b89c12 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Reject = iota // c0 == 0
	Love   = iota // c1 == 1
	Keep   = iota // c2 == 2
)

rating

View Source
const (
	Importing = iota
	Imported  = iota
)

states use to recover on massive image list processing

View Source
const (
	ImportToFinish = 1 << iota // a == 1 (iota has been reset)
	ToEdit         = 1 << iota
	HasRaw         = 1 << iota
	IsACopy        = 1 << iota // when phot is a copy, the original ID is stored in the field OriginalPhoto
)

flags

Variables

This section is empty.

Functions

This section is empty.

Types

type Photo

type Photo struct {
	ID            uuid.UUID `json:"id" db:"id"`
	CreatedAt     time.Time `json:"created_at" db:"created_at"`
	UpdatedAt     time.Time `json:"updated_at" db:"updated_at"`
	Path          string    `json:"path" db:"path"`
	JpegFilename  string    `json:"jpeg_filename" db:"jpeg_filename"`
	RawFilename   string    `json:"raw_filename" db:"raw_filename"`
	Rating        int       `json:"rating" db:"rating"`
	Flags         int64     `json:"flags" db:"flags"`
	OriginalPhoto uuid.UUID `json:"original_photo" db:"original_photo"` // the ID of original if this one is a copy
}

Photo is used by pop to map your photos database table to your go code.

func (Photo) String

func (p Photo) String() string

String is not required by pop and may be deleted

func (*Photo) Validate

func (p *Photo) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*Photo) ValidateCreate

func (p *Photo) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*Photo) ValidateUpdate

func (p *Photo) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

Jump to

Keyboard shortcuts

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