Documentation ¶
Index ¶
- Variables
- func AddNamespaceIfRequired(namespace string, name string) string
- func ParsePermissionName(s string) string
- type Filter
- type Permission
- type Repository
- type Service
- func (s Service) Delete(ctx context.Context, id string) error
- func (s Service) Get(ctx context.Context, id string) (Permission, error)
- func (s Service) List(ctx context.Context, flt Filter) ([]Permission, error)
- func (s Service) Update(ctx context.Context, perm Permission) (Permission, error)
- func (s Service) Upsert(ctx context.Context, perm Permission) (Permission, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AddNamespaceIfRequired ¶ added in v0.7.5
func ParsePermissionName ¶
Types ¶
type Permission ¶
type Permission struct { ID string Name string Slug string NamespaceID string Metadata metadata.Metadata CreatedAt time.Time UpdatedAt time.Time }
func (Permission) GenerateSlug ¶
func (p Permission) GenerateSlug() string
type Repository ¶
type Repository interface { Get(ctx context.Context, id string) (Permission, error) GetBySlug(ctx context.Context, id string) (Permission, error) Upsert(ctx context.Context, action Permission) (Permission, error) List(ctx context.Context, flt Filter) ([]Permission, error) Update(ctx context.Context, action Permission) (Permission, error) Delete(ctx context.Context, id string) error }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repository Repository) *Service
func (Service) Delete ¶
Delete call over a service could be dangerous without removing all of its relations the method does not do it by default
func (Service) Update ¶
func (s Service) Update(ctx context.Context, perm Permission) (Permission, error)
func (Service) Upsert ¶
func (s Service) Upsert(ctx context.Context, perm Permission) (Permission, error)
Click to show internal directories.
Click to hide internal directories.