Documentation
¶
Index ¶
Constants ¶
View Source
const KeepAlivePollPeriod = 3
KeepAlivePollPeriod is a Pg/MySQL keepalive check time period
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileContentRepo ¶
type FileContentRepo interface {
Upload(context.Context, *model.DBFile, []byte) error
Download(context.Context, *model.DBFile) ([]byte, error)
}
FileContentRepo is a store for file content
type FileMetaRepo ¶
type FileMetaRepo interface {
GetFileMeta(context.Context, uuid.UUID) (*model.DBFile, error)
CreateFileMeta(context.Context, *model.DBFile) (*model.DBFile, error)
UpdateFileMeta(context.Context, *model.DBFile) (*model.DBFile, error)
DeleteFileMeta(context.Context, uuid.UUID) error
}
FileMetaRepo is a store for files
type Store ¶
type Store struct {
Pg *pg.DB // for KeepAlivePg (see below)
MySQL *mysql.MySQL // for KeepAliveMySQL (see below)
User UserRepo
File FileMetaRepo
FileContent FileContentRepo
}
Store contains all repositories
func (*Store) KeepAliveMySQL ¶
func (store *Store) KeepAliveMySQL()
KeepAliveMySQL makes sure MySQL is alive and reconnects if needed
func (*Store) KeepAlivePg ¶
func (store *Store) KeepAlivePg()
KeepAlivePg makes sure PostgreSQL is alive and reconnects if needed
type UserRepo ¶
type UserRepo interface {
GetUser(context.Context, uuid.UUID) (*model.DBUser, error)
CreateUser(context.Context, *model.DBUser) (*model.DBUser, error)
UpdateUser(context.Context, *model.DBUser) (*model.DBUser, error)
DeleteUser(context.Context, uuid.UUID) error
}
UserRepo is a store for users
Click to show internal directories.
Click to hide internal directories.