Documentation
¶
Index ¶
- Variables
- type DefaultEnvironmentsService
- type Option
- type Service
- type ServiceWithLogging
- func (_d ServiceWithLogging) CreateOrganization(ctx context.Context, userSlug slug.Slug, actor model.EventActor, ...) (op1 *model.Organization, err error)
- func (_d ServiceWithLogging) DeleteOrganization(ctx context.Context, orgSlug slug.Slug) (err error)
- func (_d ServiceWithLogging) GetOrganization(ctx context.Context, orgSlug slug.Slug) (op1 *model.Organization, err error)
- func (_d ServiceWithLogging) GetRetentionPolicy(ctx context.Context, orgSlug slug.Slug) (o1 model.OrganizationRetentionPolicy, err error)
- func (_d ServiceWithLogging) ListOrganizations(ctx context.Context, userSlug slug.Slug, req model.ListRequest) (p1 model.ListResponse[model.OrganizationWithRole], err error)
- func (_d ServiceWithLogging) UpdateOrganization(ctx context.Context, orgSlug slug.Slug, actor model.EventActor, ...) (op1 *model.Organization, err error)
- func (_d ServiceWithLogging) UpdateRetentionPolicy(ctx context.Context, orgSlug slug.Slug, actor model.EventActor, ...) (o1 model.OrganizationRetentionPolicy, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrOrganizationNotFound = organizations.ErrNotFound ErrSlugAlreadyExists = organizations.ErrSlugAlreadyExists )
Re-exported from repository layer — single source of truth.
View Source
var ( ErrInvalidUserSlug = xerror.InvalidInput(xerror.User) ErrInvalidOrgSlug = xerror.InvalidInput(xerror.Organization) ErrDeletionBlocked = xerror.New(xerror.KindAlreadyExists, "ORGANIZATION_DELETION_BLOCKED", "remove projects and data sources, resolve outstanding processing, and wait for Snowflake workload identity cleanup to complete before retrying organization deletion") )
Service-only errors.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service interface {
DeleteOrganization(ctx context.Context, orgSlug slug.Slug) error
CreateOrganization(
ctx context.Context,
userSlug slug.Slug,
actor model.EventActor,
newOrg model.NewOrganization,
) (*model.Organization, error)
ListOrganizations(
ctx context.Context,
userSlug slug.Slug,
req model.ListRequest,
) (model.ListResponse[model.OrganizationWithRole], error)
GetOrganization(ctx context.Context, orgSlug slug.Slug) (*model.Organization, error)
GetRetentionPolicy(ctx context.Context, orgSlug slug.Slug) (model.OrganizationRetentionPolicy, error)
UpdateRetentionPolicy(
ctx context.Context,
orgSlug slug.Slug,
actor model.EventActor,
policy model.OrganizationRetentionPolicy,
) (model.OrganizationRetentionPolicy, error)
UpdateOrganization(
ctx context.Context,
orgSlug slug.Slug,
actor model.EventActor,
update model.UpdateOrganization,
) (*model.Organization, error)
}
Service defines the organization business logic.
func New ¶
func New( txm postgres.TransactionManager, orgsRepo organizations.Repository, environmentsService DefaultEnvironmentsService, membersService memberssvc.Service, rolesService rolessvc.Service, eventProducer workerproducer.EventProducer, admission admissionsvc.Service, options ...Option, ) Service
New creates a new organization service.
type ServiceWithLogging ¶
type ServiceWithLogging struct {
// contains filtered or unexported fields
}
ServiceWithLogging implements Service with method completion logging.
func (ServiceWithLogging) CreateOrganization ¶
func (_d ServiceWithLogging) CreateOrganization(ctx context.Context, userSlug slug.Slug, actor model.EventActor, newOrg model.NewOrganization) (op1 *model.Organization, err error)
CreateOrganization implements Service.
func (ServiceWithLogging) DeleteOrganization ¶
DeleteOrganization implements Service.
func (ServiceWithLogging) GetOrganization ¶
func (_d ServiceWithLogging) GetOrganization(ctx context.Context, orgSlug slug.Slug) (op1 *model.Organization, err error)
GetOrganization implements Service.
func (ServiceWithLogging) GetRetentionPolicy ¶
func (_d ServiceWithLogging) GetRetentionPolicy(ctx context.Context, orgSlug slug.Slug) (o1 model.OrganizationRetentionPolicy, err error)
GetRetentionPolicy implements Service.
func (ServiceWithLogging) ListOrganizations ¶
func (_d ServiceWithLogging) ListOrganizations(ctx context.Context, userSlug slug.Slug, req model.ListRequest) (p1 model.ListResponse[model.OrganizationWithRole], err error)
ListOrganizations implements Service.
func (ServiceWithLogging) UpdateOrganization ¶
func (_d ServiceWithLogging) UpdateOrganization(ctx context.Context, orgSlug slug.Slug, actor model.EventActor, update model.UpdateOrganization) (op1 *model.Organization, err error)
UpdateOrganization implements Service.
func (ServiceWithLogging) UpdateRetentionPolicy ¶
func (_d ServiceWithLogging) UpdateRetentionPolicy(ctx context.Context, orgSlug slug.Slug, actor model.EventActor, policy model.OrganizationRetentionPolicy) (o1 model.OrganizationRetentionPolicy, err error)
UpdateRetentionPolicy implements Service.
Click to show internal directories.
Click to hide internal directories.