admin

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnauthorized         = errors.New("unauthorized")
	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 (s *Service) CreateUser(ctx context.Context, req *models.UserCreateRequest) (*models.User, error)

func (*Service) DeleteOrganization

func (s *Service) DeleteOrganization(ctx context.Context, userID, organizationID string) error

func (*Service) DeleteUser

func (s *Service) DeleteUser(ctx context.Context, userID string) error

func (*Service) GetOrganization

func (s *Service) GetOrganization(ctx context.Context, userID, organizationID string) (*models.Organization, error)

func (*Service) GetUser

func (s *Service) GetUser(ctx context.Context, userID string) (*models.User, error)

func (*Service) ListOrganizationMembers

func (s *Service) ListOrganizationMembers(ctx context.Context, userID, organizationID string) ([]*models.OrganizationMember, error)

func (*Service) ListOrganizations

func (s *Service) ListOrganizations(ctx context.Context, userID string) ([]*models.Organization, error)

func (*Service) RemoveOrganizationMember

func (s *Service) RemoveOrganizationMember(ctx context.Context, userID, organizationID, targetUserID string) error

func (*Service) UpdateOrganization

func (s *Service) UpdateOrganization(ctx context.Context, userID, organizationID string, req *models.OrganizationUpdateRequest) (*models.Organization, error)

func (*Service) UpdateUser

func (s *Service) UpdateUser(ctx context.Context, userID string, req *models.UserUpdateRequest) (*models.User, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL