Documentation
¶
Index ¶
- Constants
- Variables
- func Migrate(db *sql.DB, dir string) error
- func MigrateFS(db *sql.DB, migrations fs.FS, dir string) error
- func Open(cfg PostgresCfg) (*sql.DB, error)
- type FileError
- type Gallery
- type GalleryService
- func (g *GalleryService) ByID(ctx context.Context, id int) (*Gallery, error)
- func (g *GalleryService) ByUserID(ctx context.Context, userID int) ([]Gallery, error)
- func (g *GalleryService) Create(ctx context.Context, title string, userID int) (*Gallery, error)
- func (g *GalleryService) CreateImage(galleryID int, filename string, content io.ReadSeeker) error
- func (g *GalleryService) Delete(ctx context.Context, id int) error
- func (g *GalleryService) DeleteImage(galleryID int, filename string) error
- func (g *GalleryService) Image(galleryID int, filename string) (Image, error)
- func (g *GalleryService) Images(galleryID int) ([]Image, error)
- func (g *GalleryService) Update(ctx context.Context, gallery *Gallery) error
- type Image
- type NewUser
- type PasswordReset
- type PasswordResetService
- type PostgresCfg
- type Session
- type SessionService
- type User
- type UserService
Constants ¶
View Source
const (
DefaultResetDuration = 1 * time.Hour
)
View Source
const MinBytesPerToken = 32
Variables ¶
Functions ¶
Types ¶
type GalleryService ¶
func (*GalleryService) CreateImage ¶
func (g *GalleryService) CreateImage(galleryID int, filename string, content io.ReadSeeker) error
func (*GalleryService) DeleteImage ¶
func (g *GalleryService) DeleteImage(galleryID int, filename string) error
type PasswordReset ¶
type PasswordResetService ¶
func (*PasswordResetService) Create ¶
func (p *PasswordResetService) Create(ctx context.Context, email string) (*PasswordReset, error)
type PostgresCfg ¶
type PostgresCfg struct {
Host string
Port string
User string
Password string
Database string
SSLMode string
}
func (*PostgresCfg) String ¶
func (c *PostgresCfg) String() string
type SessionService ¶
type UserService ¶
func (*UserService) Authenticate ¶
func (*UserService) UpdatePassword ¶
Click to show internal directories.
Click to hide internal directories.