Versions in this module Expand all Collapse all v1 v1.0.0 Apr 25, 2022 Changes in this version + var ErrMissingAPIKeyPolicy = errors.New("an initial API key policy is required") + type APIKeyRepository struct + func (repo *APIKeyRepository) Create(ctx context.Context, create *apikey.Create) (*apikey.Key, string, error) + func (repo *APIKeyRepository) Delete(ctx context.Context, id uuid.UUID) error + func (repo *APIKeyRepository) Get(ctx context.Context, offset, limit uint64) ([]*apikey.Key, uint64, error) + func (repo *APIKeyRepository) GetByID(ctx context.Context, id uuid.UUID) (*apikey.Key, error) + func (repo *APIKeyRepository) GetByRawKey(ctx context.Context, key string) (*apikey.Key, error) + func (repo *APIKeyRepository) GetByUserID(ctx context.Context, userID string, offset, limit uint64) ([]*apikey.Key, uint64, error) + func (repo *APIKeyRepository) Update(ctx context.Context, id uuid.UUID, update *apikey.Update) (*apikey.Key, error) + func (repo *APIKeyRepository) UpdateManyQuotas(ctx context.Context, updates map[uuid.UUID]int64) error + type Driver struct + func New(dsn string) *Driver + func (driver *Driver) APIKeys() apikey.Repository + func (driver *Driver) Close() + func (driver *Driver) Initialize(ctx context.Context) error + func (driver *Driver) METARs() metar.Repository + func (driver *Driver) Users() user.Repository + type METARRepository struct + func (repo *METARRepository) Create(ctx context.Context, raw []string) ([]*metar.METAR, []uint, error) + func (repo *METARRepository) Delete(ctx context.Context, id uuid.UUID) error + func (repo *METARRepository) GetByFilter(ctx context.Context, filter *metar.Filter, limit uint64) ([]*metar.METAR, uint64, error) + func (repo *METARRepository) GetByID(ctx context.Context, id uuid.UUID) (*metar.METAR, error) + type UserRepository struct + func (repo *UserRepository) Create(ctx context.Context, create *user.Create) (*user.User, error) + func (repo *UserRepository) Delete(ctx context.Context, id string) error + func (repo *UserRepository) Get(ctx context.Context, offset, limit uint64) ([]*user.User, uint64, error) + func (repo *UserRepository) GetByID(ctx context.Context, id string) (*user.User, error) + func (repo *UserRepository) Update(ctx context.Context, id string, update *user.Update) (*user.User, error)