deleter

package
v0.115.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DisableDeleteIfBilled = true
)

Variables

View Source
var (
	ErrDeleteNotAllowed = fmt.Errorf("deletion not allowed for billed accounts")
)

Functions

This section is empty.

Types

type CheckoutService added in v0.114.0

type CheckoutService interface {
	List(ctx context.Context, filter checkout.Filter) ([]checkout.Checkout, error)
	DeleteByCustomer(ctx context.Context, customerID string) error
}

type CreditService added in v0.114.0

type CreditService interface {
	DeleteByAccountID(ctx context.Context, accountID string) error
}

type CustomerService added in v0.8.35

type CustomerService interface {
	Delete(ctx context.Context, id string) error
	List(ctx context.Context, filter customer.Filter) ([]customer.Customer, error)
}

type GroupService

type GroupService interface {
	List(ctx context.Context, flt group.Filter) ([]group.Group, error)
	DeleteModel(ctx context.Context, id string) error
}

type InvitationService

type InvitationService interface {
	List(ctx context.Context, flt invitation.Filter) ([]invitation.Invitation, error)
	Delete(ctx context.Context, id uuid.UUID) error
}

type InvoiceService added in v0.8.35

type InvoiceService interface {
	List(ctx context.Context, flt invoice.Filter) ([]invoice.Invoice, error)
	DeleteByCustomer(ctx context.Context, customr customer.Customer) error
}

type KycService added in v0.114.0

type KycService interface {
	DeleteKyc(ctx context.Context, orgID string) error
}

type MembershipService added in v0.103.0

type MembershipService interface {
	OnGroupDeleted(ctx context.Context, groupID string) error
	ListResourcesByPrincipal(ctx context.Context, principal authenticate.Principal, resourceType string, filter membership.ResourceFilter) ([]string, error)
	ForceRemoveOrganizationMember(ctx context.Context, orgID, principalID, principalType string) error
}

type OrganizationService

type OrganizationService interface {
	Get(ctx context.Context, id string) (organization.Organization, error)
	DeleteModel(ctx context.Context, id string) error
}

type PolicyService

type PolicyService interface {
	List(ctx context.Context, flt policy.Filter) ([]policy.Policy, error)
	Delete(ctx context.Context, id string) error
}

type ProjectService

type ProjectService interface {
	List(ctx context.Context, flt project.Filter) ([]project.Project, error)
	DeleteModel(ctx context.Context, id string) error
}

type ResourceService

type ResourceService interface {
	List(ctx context.Context, flt resource.Filter) ([]resource.Resource, error)
	Delete(ctx context.Context, namespaceID, id string) error
}

type RoleService

type RoleService interface {
	List(ctx context.Context, flt role.Filter) ([]role.Role, error)
	Delete(ctx context.Context, id string) error
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewCascadeDeleter

func NewCascadeDeleter(orgService OrganizationService, projService ProjectService,
	resService ResourceService, groupService GroupService,
	membershipService MembershipService,
	policyService PolicyService, roleService RoleService,
	invitationService InvitationService, userService UserService,
	userPATService UserPATService,
	serviceUserService ServiceUserService,
	customerService CustomerService, subService SubscriptionService,
	invoiceService InvoiceService, checkoutService CheckoutService,
	creditService CreditService, kycService KycService) *Service

func (Service) DeleteCustomers added in v0.8.35

func (d Service) DeleteCustomers(ctx context.Context, id string) error

func (Service) DeleteGroup added in v0.103.0

func (d Service) DeleteGroup(ctx context.Context, id string) error

DeleteGroup orchestrates teardown of a single group: clears every member's policies and relations plus the org<->group hierarchy relations via membership, then deletes the group entity itself.

func (Service) DeleteOrganization

func (d Service) DeleteOrganization(ctx context.Context, id string) error

DeleteOrganization removes an org and everything belonging to it. Billing is torn down first: it talks to the billing provider and is the step most likely to fail. Identity (projects, policies, and so on) goes after, with org policies (the org owners) near the end. This way a failure at any step leaves the org owned and the delete can simply be run again. Every step treats already-deleted data as success for the same reason.

func (Service) DeleteProject

func (d Service) DeleteProject(ctx context.Context, id string) error

func (Service) DeleteUser added in v0.7.6

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

DeleteUser visits every org the user has a policy on (disabled orgs too), otherwise userService.Delete would leave orphan policy rows behind.

func (Service) RemoveUsersFromOrg added in v0.7.5

func (d Service) RemoveUsersFromOrg(ctx context.Context, orgID string, userIDs []string) error

RemoveUsersFromOrg removes users from an organization as members. The policy and relation cleanup — org, project, group, and custom resource — is delegated to membership.ForceRemoveOrganizationMember. It uses the force variant because a deletion cascade must succeed even when the user is the org's last owner.

type ServiceUserService added in v0.100.0

type ServiceUserService interface {
	List(ctx context.Context, flt serviceuser.Filter) ([]serviceuser.ServiceUser, error)
	Delete(ctx context.Context, id string) error
}

type SubscriptionService added in v0.8.35

type SubscriptionService interface {
	DeleteByCustomer(ctx context.Context, customr customer.Customer) error
}

type UserPATService added in v0.106.0

type UserPATService interface {
	DeleteAllByUser(ctx context.Context, userID string) error
}

type UserService added in v0.7.6

type UserService interface {
	Delete(ctx context.Context, id string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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