Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = xerror.NotFound(xerror.PersonalAccessToken) ErrSlugAlreadyExists = xerror.AlreadyExists(xerror.PersonalAccessToken) )
Functions ¶
This section is empty.
Types ¶
type CreateParams ¶
type PersonalAccessToken ¶
type Repository ¶
type Repository interface {
Create(ctx context.Context, tx postgres.DBTX, params CreateParams) (*PersonalAccessToken, error)
FindBySlug(ctx context.Context, tx postgres.DBTX, userSlug, patSlug slug.Slug) (*PersonalAccessToken, error)
ListByUser(
ctx context.Context,
tx postgres.DBTX,
userSlug slug.Slug,
req model.ListRequest,
) ([]*PersonalAccessToken, error)
Update(ctx context.Context, tx postgres.DBTX, params UpdateParams) error
Revoke(ctx context.Context, tx postgres.DBTX, userSlug, patSlug slug.Slug) error
DeleteRevoked(ctx context.Context, tx postgres.DBTX, userSlug, patSlug slug.Slug) error
Rotate(ctx context.Context, tx postgres.DBTX, params RotateParams) (*PersonalAccessToken, error)
FindActivePrincipalByTokenHash(ctx context.Context, tx postgres.DBTX, tokenHash string) (*Principal, error)
MarkUsed(ctx context.Context, tx postgres.DBTX, userSlug, patSlug slug.Slug) error
}
func NewRepository ¶
func NewRepository() Repository
type RotateParams ¶
Click to show internal directories.
Click to hide internal directories.