Documentation ¶
Index ¶
- Constants
- Variables
- type ActivityService
- type CachedRepository
- type Filter
- type Group
- type LogData
- type RelationService
- type Repository
- type Service
- func (s Service) Create(ctx context.Context, grp Group) (Group, error)
- func (s Service) Get(ctx context.Context, idOrSlug string) (Group, error)
- func (s Service) GetByIDs(ctx context.Context, groupIDs []string) ([]Group, error)
- func (s Service) GetBySlug(ctx context.Context, slug string) (Group, error)
- func (s Service) List(ctx context.Context, flt Filter) ([]Group, error)
- func (s Service) ListGroupRelations(ctx context.Context, objectId, subjectType, role string) ([]user.User, []Group, map[string][]string, map[string][]string, error)
- func (s Service) ListUserGroups(ctx context.Context, userId string, roleId string) ([]Group, error)
- func (s Service) Update(ctx context.Context, grp Group) (Group, error)
- type UserService
Constants ¶
View Source
const AuditEntity = "group"
Variables ¶
View Source
var ( ErrNotExist = errors.New("group doesn't exist") ErrInvalidUUID = errors.New("invalid syntax of uuid") ErrInvalidID = errors.New("group id is invalid") ErrConflict = errors.New("group already exist") ErrInvalidDetail = errors.New("invalid group detail") ErrListingGroupRelations = errors.New("error while listing relations") ErrFetchingUsers = errors.New("error while fetching users") ErrFetchingGroups = errors.New("error while fetching groups") ErrLogActivity = errors.New("error while logging activity") )
Functions ¶
This section is empty.
Types ¶
type ActivityService ¶ added in v0.6.15
type CachedRepository ¶ added in v0.6.26
type Group ¶
type RelationService ¶
type RelationService interface { Create(ctx context.Context, rel relation.RelationV2) (relation.RelationV2, error) Delete(ctx context.Context, rel relation.Relation) error CheckPermission(ctx context.Context, usr user.User, resourceNS namespace.Namespace, resourceIdxa string, action action.Action) (bool, error) }
type Repository ¶
type Repository interface { Create(ctx context.Context, grp Group) (Group, error) GetByID(ctx context.Context, id string) (Group, error) GetByIDs(ctx context.Context, groupIDs []string) ([]Group, error) GetBySlug(ctx context.Context, slug string) (Group, error) List(ctx context.Context, flt Filter) ([]Group, error) UpdateByID(ctx context.Context, toUpdate Group) (Group, error) UpdateBySlug(ctx context.Context, toUpdate Group) (Group, error) ListUserGroups(ctx context.Context, userId string, roleId string) ([]Group, error) ListGroupRelations(ctx context.Context, objectId, subjectType, role string) ([]relation.RelationV2, error) }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(logger log.Logger, repository Repository, cacheRepository CachedRepository, relationService RelationService, userService UserService, activityService ActivityService) *Service
func (Service) ListGroupRelations ¶
func (Service) ListUserGroups ¶
Click to show internal directories.
Click to hide internal directories.