Documentation
¶
Index ¶
- Variables
- type AddToRoleParams
- type ClearRolePermissionsParams
- type CreateParams
- type Permission
- type RemoveFromRoleParams
- type Repository
- type RepositoryWithLogging
- func (_d RepositoryWithLogging) AddToRole(ctx context.Context, tx postgres.DBTX, params *AddToRoleParams) (err error)
- func (_d RepositoryWithLogging) ClearRolePermissions(ctx context.Context, tx postgres.DBTX, params *ClearRolePermissionsParams) (err error)
- func (_d RepositoryWithLogging) Create(ctx context.Context, tx postgres.DBTX, params *CreateParams) (pp1 *Permission, err error)
- func (_d RepositoryWithLogging) FindOrCreate(ctx context.Context, tx postgres.DBTX, resources []string, actions []string) (ppa1 []*Permission, err error)
- func (_d RepositoryWithLogging) ListAll(ctx context.Context, tx postgres.DBTX) (ppa1 []*Permission, err error)
- func (_d RepositoryWithLogging) ListForRole(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, roleSlug slug.Slug) (ppa1 []*Permission, err error)
- func (_d RepositoryWithLogging) RemoveFromRole(ctx context.Context, tx postgres.DBTX, params *RemoveFromRoleParams) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidInput = xerror.ValidationFailed()
Functions ¶
This section is empty.
Types ¶
type AddToRoleParams ¶
type CreateParams ¶
type Permission ¶
type RemoveFromRoleParams ¶
type Repository ¶
type Repository interface {
Create(ctx context.Context, tx postgres.DBTX, params *CreateParams) (*Permission, error)
FindOrCreate(
ctx context.Context,
tx postgres.DBTX,
resources, actions []string,
) ([]*Permission, error)
ListAll(ctx context.Context, tx postgres.DBTX) ([]*Permission, error)
ListForRole(
ctx context.Context,
tx postgres.DBTX,
orgSlug, roleSlug slug.Slug,
) ([]*Permission, error)
AddToRole(ctx context.Context, tx postgres.DBTX, params *AddToRoleParams) error
RemoveFromRole(ctx context.Context, tx postgres.DBTX, params *RemoveFromRoleParams) error
ClearRolePermissions(
ctx context.Context,
tx postgres.DBTX,
params *ClearRolePermissionsParams,
) error
}
func NewRepository ¶
func NewRepository() Repository
func NewRepositoryWithLogging ¶
func NewRepositoryWithLogging(base Repository, logger *slog.Logger) Repository
NewRepositoryWithLogging wraps base with method completion logging.
type RepositoryWithLogging ¶
type RepositoryWithLogging struct {
// contains filtered or unexported fields
}
RepositoryWithLogging implements Repository with method completion logging.
func (RepositoryWithLogging) AddToRole ¶
func (_d RepositoryWithLogging) AddToRole(ctx context.Context, tx postgres.DBTX, params *AddToRoleParams) (err error)
AddToRole implements Repository.
func (RepositoryWithLogging) ClearRolePermissions ¶
func (_d RepositoryWithLogging) ClearRolePermissions(ctx context.Context, tx postgres.DBTX, params *ClearRolePermissionsParams) (err error)
ClearRolePermissions implements Repository.
func (RepositoryWithLogging) Create ¶
func (_d RepositoryWithLogging) Create(ctx context.Context, tx postgres.DBTX, params *CreateParams) (pp1 *Permission, err error)
Create implements Repository.
func (RepositoryWithLogging) FindOrCreate ¶
func (_d RepositoryWithLogging) FindOrCreate(ctx context.Context, tx postgres.DBTX, resources []string, actions []string) (ppa1 []*Permission, err error)
FindOrCreate implements Repository.
func (RepositoryWithLogging) ListAll ¶
func (_d RepositoryWithLogging) ListAll(ctx context.Context, tx postgres.DBTX) (ppa1 []*Permission, err error)
ListAll implements Repository.
func (RepositoryWithLogging) ListForRole ¶
func (_d RepositoryWithLogging) ListForRole(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, roleSlug slug.Slug) (ppa1 []*Permission, err error)
ListForRole implements Repository.
func (RepositoryWithLogging) RemoveFromRole ¶
func (_d RepositoryWithLogging) RemoveFromRole(ctx context.Context, tx postgres.DBTX, params *RemoveFromRoleParams) (err error)
RemoveFromRole implements Repository.
Click to show internal directories.
Click to hide internal directories.