Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrNotFound modelError = "models: resource not found" ErrIDInvalid modelError = "models: ID provided was invalid" ErrPasswordIncorrect modelError = "models: incorrect password provided" ErrEmailTaken modelError = "models: email address is already taken" ErrPasswordRequired modelError = "models: password is required" ErrRememberRequired modelError = "models: remember token is required" ErrRememberTooShort modelError = "models: remember token must be at least 32 bytes" ErrBadRequst modelError = "models: bad request param" )
View Source
const (
ErrUserIDRequired modelError = "models: user ID is required"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gallery ¶
type Gallery struct { gorm.Model UserID uint `gorm:"not null;index"` Title string `gorm:"not null"` Images []Image `gorm:"-"` }
func (*Gallery) ImagesSplitN ¶
type GalleryService ¶
type GalleryService interface { GalleryDB }
func NewGalleryService ¶
func NewGalleryService(db *gorm.DB) GalleryService
type Image ¶
func (*Image) RelativePath ¶
type ImageService ¶
type ImageService interface { Create(galleryID uint, r io.Reader, filename string) error ByGalleryID(galleryID uint) ([]Image, error) Delete(image *Image) error }
func NewImageService ¶
func NewImageService() ImageService
type Services ¶
type Services struct { Gallery GalleryService User UserService Image ImageService // contains filtered or unexported fields }
func NewServices ¶
func (*Services) AutoMigrate ¶
func (*Services) DestructiveReset ¶
type UserService ¶
func NewUserService ¶
func NewUserService(db *gorm.DB) UserService
Click to show internal directories.
Click to hide internal directories.