Documentation ¶
Index ¶
- func NewAPIRepo(log logger.Logger, db *DB) domain.APIRepo
- func NewNotificationRepo(log logger.Logger, db *DB) domain.NotificationRepo
- func NewSyncRepo(log logger.Logger, db *DB) domain.SyncRepo
- func NewUserRepo(log logger.Logger, db *DB) domain.UserRepo
- type APIRepo
- type DB
- type ILikeDynamic
- type NotificationRepo
- func (r *NotificationRepo) Delete(ctx context.Context, notificationID int) error
- func (r *NotificationRepo) Find(ctx context.Context, params domain.NotificationQueryParams) ([]domain.Notification, int, error)
- func (r *NotificationRepo) FindByID(ctx context.Context, id int) (*domain.Notification, error)
- func (r *NotificationRepo) List(ctx context.Context) ([]domain.Notification, error)
- func (r *NotificationRepo) Store(ctx context.Context, notification domain.Notification) (*domain.Notification, error)
- func (r *NotificationRepo) Update(ctx context.Context, notification domain.Notification) (*domain.Notification, error)
- type SyncRepo
- func (r SyncRepo) GetSyncDataAndETag(ctx context.Context, apiKey string) ([]byte, *string, error)
- func (r SyncRepo) GetSyncDataETag(ctx context.Context, apiKey string) (*string, error)
- func (r SyncRepo) SetSyncData(ctx context.Context, apiKey string, data []byte) (*string, error)
- func (r SyncRepo) SetSyncDataIfMatch(ctx context.Context, apiKey string, etag string, data []byte) (*string, error)
- type Tx
- type UserRepo
- func (r *UserRepo) FindByUsername(ctx context.Context, username string) (*domain.User, error)
- func (r *UserRepo) GetUserCount(ctx context.Context) (int, error)
- func (r *UserRepo) Store(ctx context.Context, user domain.User) error
- func (r *UserRepo) Update(ctx context.Context, user domain.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNotificationRepo ¶
func NewNotificationRepo(log logger.Logger, db *DB) domain.NotificationRepo
Types ¶
type APIRepo ¶
type APIRepo struct {
// contains filtered or unexported fields
}
type ILikeDynamic ¶
func ILike ¶
func ILike(col string, val string) ILikeDynamic
ILike is a wrapper for sq.Like and sq.ILike SQLite does not support ILike but postgres does so this checks what database is being used
type NotificationRepo ¶
type NotificationRepo struct {
// contains filtered or unexported fields
}
func (*NotificationRepo) Delete ¶
func (r *NotificationRepo) Delete(ctx context.Context, notificationID int) error
func (*NotificationRepo) Find ¶
func (r *NotificationRepo) Find(ctx context.Context, params domain.NotificationQueryParams) ([]domain.Notification, int, error)
func (*NotificationRepo) FindByID ¶
func (r *NotificationRepo) FindByID(ctx context.Context, id int) (*domain.Notification, error)
func (*NotificationRepo) List ¶
func (r *NotificationRepo) List(ctx context.Context) ([]domain.Notification, error)
func (*NotificationRepo) Store ¶
func (r *NotificationRepo) Store(ctx context.Context, notification domain.Notification) (*domain.Notification, error)
func (*NotificationRepo) Update ¶
func (r *NotificationRepo) Update(ctx context.Context, notification domain.Notification) (*domain.Notification, error)
type SyncRepo ¶
type SyncRepo struct {
// contains filtered or unexported fields
}
func (SyncRepo) GetSyncDataAndETag ¶ added in v1.0.0
Get sync data and etag
func (SyncRepo) GetSyncDataETag ¶ added in v1.0.0
Get etag of sync data. For avoid memory usage, only the etag will be returned.
func (SyncRepo) SetSyncData ¶ added in v1.0.0
Create or replace sync data, returns the new etag.
type UserRepo ¶
type UserRepo struct {
// contains filtered or unexported fields
}
func (*UserRepo) FindByUsername ¶
Click to show internal directories.
Click to hide internal directories.