Documentation ¶
Index ¶
- Constants
- Variables
- type ActivityService
- type LogData
- type Organization
- type RelationService
- type Repository
- type Service
- func (s Service) Create(ctx context.Context, org Organization) (Organization, error)
- func (s Service) Get(ctx context.Context, idOrSlug string) (Organization, error)
- func (s Service) List(ctx context.Context) ([]Organization, error)
- func (s Service) ListAdmins(ctx context.Context, idOrSlug string) ([]user.User, error)
- func (s Service) Update(ctx context.Context, org Organization) (Organization, error)
- type UserService
Constants ¶
View Source
const AuditEntity = "organization"
Variables ¶
View Source
var ( ErrNotExist = errors.New("org doesn't exist") ErrInvalidUUID = errors.New("invalid syntax of uuid") ErrInvalidID = errors.New("org id is invalid") ErrConflict = errors.New("org already exist") ErrInvalidDetail = errors.New("invalid org detail") ErrLogActivity = errors.New("error while logging activity") )
Functions ¶
This section is empty.
Types ¶
type ActivityService ¶ added in v0.6.15
type Organization ¶
type Organization struct { ID string Name string Slug string Metadata metadata.Metadata CreatedAt time.Time UpdatedAt time.Time }
func (Organization) ToLogData ¶ added in v0.6.25
func (organization Organization) ToLogData() LogData
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 { GetByID(ctx context.Context, id string) (Organization, error) GetBySlug(ctx context.Context, slug string) (Organization, error) Create(ctx context.Context, org Organization) (Organization, error) List(ctx context.Context) ([]Organization, error) UpdateByID(ctx context.Context, org Organization) (Organization, error) UpdateBySlug(ctx context.Context, org Organization) (Organization, error) ListAdminsByOrgID(ctx context.Context, id string) ([]user.User, error) }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(logger log.Logger, repository Repository, relationService RelationService, userService UserService, activityService ActivityService) *Service
func (Service) Create ¶
func (s Service) Create(ctx context.Context, org Organization) (Organization, error)
func (Service) ListAdmins ¶
func (Service) Update ¶
func (s Service) Update(ctx context.Context, org Organization) (Organization, error)
Click to show internal directories.
Click to hide internal directories.