Documentation
¶
Index ¶
- func GenerateWookieMiddleware(wookieSvc *WookieService) service.Middleware
- type Model
- type MySQLRepository
- type PostgresRepository
- type SQLiteRepository
- type Wookie
- type WookieRepository
- type WookieService
- func (svc WookieService) CreateNewWookie(ctx context.Context) (*wookie.Token, error)
- func (svc WookieService) GetById(ctx context.Context, id int64) (*wookie.Token, error)
- func (svc WookieService) GetLatestWookie(ctx context.Context) (*wookie.Token, error)
- func (svc WookieService) WithNewWookie(ctx context.Context, ...) (*wookie.Token, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateWookieMiddleware ¶ added in v0.43.0
func GenerateWookieMiddleware(wookieSvc *WookieService) service.Middleware
Types ¶
type MySQLRepository ¶
type MySQLRepository struct {
database.SQLRepository
}
func NewMySQLRepository ¶
func NewMySQLRepository(db *database.MySQL) *MySQLRepository
type PostgresRepository ¶
type PostgresRepository struct {
database.SQLRepository
}
func NewPostgresRepository ¶
func NewPostgresRepository(db *database.Postgres) *PostgresRepository
type SQLiteRepository ¶
type SQLiteRepository struct {
database.SQLRepository
}
func NewSQLiteRepository ¶
func NewSQLiteRepository(db *database.SQLite) *SQLiteRepository
type Wookie ¶
type Wookie struct {
ID int64 `mysql:"id" postgres:"id" sqlite:"id"`
Version int64 `mysql:"ver" postgres:"ver" sqlite:"ver"`
CreatedAt time.Time `mysql:"createdAt" postgres:"created_at" sqlite:"createdAt"`
}
func (Wookie) GetCreatedAt ¶
func (Wookie) GetVersion ¶
type WookieRepository ¶
type WookieRepository interface {
Create(ctx context.Context, version int64) (int64, error)
GetById(ctx context.Context, id int64) (Model, error)
GetLatest(ctx context.Context) (Model, error)
}
func NewRepository ¶
func NewRepository(db database.Database) (WookieRepository, error)
type WookieService ¶
type WookieService struct {
service.BaseService
Repository WookieRepository
}
func NewService ¶
func NewService(env service.Env, repository WookieRepository) *WookieService
func (WookieService) CreateNewWookie ¶ added in v0.39.0
func (WookieService) GetLatestWookie ¶ added in v0.39.0
Click to show internal directories.
Click to hide internal directories.