models

package
v0.0.0-...-2dc537c Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRecordNotFound = gorm.ErrRecordNotFound
)

Functions

func GetImageInStorage

func GetImageInStorage(path string) (image.Image, error)

func RemoveImageByID

func RemoveImageByID(id int) error

func RemoveImageByName

func RemoveImageByName(name string) error

func RemoveImageInStorage

func RemoveImageInStorage(path string) error

func ReplaceImageByName

func ReplaceImageByName(name, path string) error

func SaveNewImage

func SaveNewImage(img *Image) error

Types

type Image

type Image struct {
	ID        int       `json:"id,omitempty"`
	Name      string    `json:"name,omitempty" gorm:"unique"`
	Ext       string    `json:"ext"`
	Path      string    `json:"path,omitempty"`
	CreatedAt time.Time `json:"createdAt,omitempty"`
	UpdatedAt time.Time `json:"updatedAt,omitempty"`
}

func GetImageByID

func GetImageByID(id int) (*Image, error)

func GetImageByName

func GetImageByName(name string) (*Image, error)

func GetImageList

func GetImageList() ([]*Image, error)

Jump to

Keyboard shortcuts

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