db

package
v0.0.0-...-4702f85 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(conn *DBConn, dbcfg config.Database) (err error)

Types

type DBConn

type DBConn struct {
	// contains filtered or unexported fields
}

func (DBConn) CheckModels

func (db DBConn) CheckModels() (err error)

func (DBConn) Close

func (db DBConn) Close() (err error)

func (DBConn) Insert

func (db DBConn) Insert()

func (DBConn) LastTenImages

func (db DBConn) LastTenImages() (images []Image, err error)

type Image

type Image struct {
	ID          uint8 `gorm:"primary_key"`
	Camera      string
	ShootDate   time.Time
	PublishDate time.Time
	Path        string
	Tags        []Tag `gorm:"many2many:images_tags;"`
}

type TableNotCreatedError

type TableNotCreatedError struct {
	TableName string
	Err       error
}

func (TableNotCreatedError) Error

func (e TableNotCreatedError) Error() string

type TableNotFoundError

type TableNotFoundError struct {
	TableName string
}

func (TableNotFoundError) Error

func (e TableNotFoundError) Error() string

type Tag

type Tag struct {
	ID     uint8 `gorm:"primary_key"`
	Text   string
	Images []Image `gorm:"many2many: images_tags;"`
}

Jump to

Keyboard shortcuts

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