Documentation
¶
Index ¶
- Variables
- type Service
- func (s *Service) AddOrganizationMember(ctx context.Context, userID, organizationID string, ...) (*models.OrganizationMember, error)
- func (s *Service) CreateOrganization(ctx context.Context, userID string, req *models.OrganizationCreateRequest) (*models.Organization, error)
- func (s *Service) CreateUser(ctx context.Context, req *models.UserCreateRequest) (*models.User, error)
- func (s *Service) DeleteOrganization(ctx context.Context, userID, organizationID string) error
- func (s *Service) DeleteUser(ctx context.Context, userID string) error
- func (s *Service) GetOrganization(ctx context.Context, userID, organizationID string) (*models.Organization, error)
- func (s *Service) GetUser(ctx context.Context, userID string) (*models.User, error)
- func (s *Service) ListOrganizationMembers(ctx context.Context, userID, organizationID string) ([]*models.OrganizationMember, error)
- func (s *Service) ListOrganizations(ctx context.Context, userID string) ([]*models.Organization, error)
- func (s *Service) RemoveOrganizationMember(ctx context.Context, userID, organizationID, targetUserID string) error
- func (s *Service) UpdateOrganization(ctx context.Context, userID, organizationID string, ...) (*models.Organization, error)
- func (s *Service) UpdateUser(ctx context.Context, userID string, req *models.UserUpdateRequest) (*models.User, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrOrganizationExists = errors.New("organization already exists") ErrOrganizationNotFound = errors.New("organization not found") ErrUserExists = errors.New("user already exists") ErrUserNotFound = errors.New("user not found") ErrMemberNotFound = errors.New("member not found") ErrCannotRemoveOwner = errors.New("cannot remove organization owner") )
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(db *gorm.DB, authProvider auth.AuthProvider) *Service
func (*Service) AddOrganizationMember ¶
func (s *Service) AddOrganizationMember(ctx context.Context, userID, organizationID string, req *models.AddOrganizationMemberRequest) (*models.OrganizationMember, error)
func (*Service) CreateOrganization ¶
func (s *Service) CreateOrganization(ctx context.Context, userID string, req *models.OrganizationCreateRequest) (*models.Organization, error)
func (*Service) CreateUser ¶
func (*Service) DeleteOrganization ¶
func (*Service) GetOrganization ¶
func (*Service) ListOrganizationMembers ¶
func (*Service) ListOrganizations ¶
func (*Service) RemoveOrganizationMember ¶
func (*Service) UpdateOrganization ¶
func (s *Service) UpdateOrganization(ctx context.Context, userID, organizationID string, req *models.OrganizationUpdateRequest) (*models.Organization, error)
Click to show internal directories.
Click to hide internal directories.