domain

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module("domain", fx.Provide(NewDomain))

Functions

This section is empty.

Types

type AccountService

type AccountService interface {
	CheckNameAvailability(ctx context.Context, name string) (*CheckNameAvailabilityOutput, error)

	ListAccounts(ctx UserContext) ([]*entities.Account, error)
	GetAccount(ctx UserContext, name string) (*entities.Account, error)

	CreateAccount(ctx UserContext, account entities.Account) (*entities.Account, error)
	UpdateAccount(ctx UserContext, account entities.Account) (*entities.Account, error)
	DeleteAccount(ctx UserContext, name string) (bool, error)

	ResyncAccount(ctx UserContext, name string) error

	ActivateAccount(ctx UserContext, name string) (bool, error)
	DeactivateAccount(ctx UserContext, name string) (bool, error)

	EnsureKloudliteRegistryCredentials(ctx UserContext, accountName string) error

	AvailableKloudliteRegions(ctx UserContext) ([]*AvailableKloudliteRegion, error)
}

type AvailableKloudliteRegion

type AvailableKloudliteRegion struct {
	ID          string `json:"id"`
	DisplayName string `json:"displayName"`
}

type CheckNameAvailabilityOutput

type CheckNameAvailabilityOutput struct {
	Result         bool     `json:"result"`
	SuggestedNames []string `json:"suggestedNames,omitempty"`
}

type Domain

func NewDomain

func NewDomain(
	iamCli iam.IAMClient,
	consoleClient console.ConsoleClient,

	authClient auth.AuthClient,
	commsClient comms.CommsClient,

	k8sClient k8s.Client,

	accountRepo repos.DbRepo[*entities.Account],
	invitationRepo repos.DbRepo[*entities.Invitation],

	ev *env.Env,

	logger logging.Logger,
) Domain

type InvitationService

type InvitationService interface {
	InviteMembers(ctx UserContext, accountName string, invitations []*entities.Invitation) ([]*entities.Invitation, error)
	ResendInviteEmail(ctx UserContext, accountName string, invitationId repos.ID) (bool, error)

	ListInvitations(ctx UserContext, accountName string) ([]*entities.Invitation, error)
	GetInvitation(ctx UserContext, accountName string, invitationId repos.ID) (*entities.Invitation, error)

	ListInvitationsForUser(ctx UserContext, onlyPending bool) ([]*entities.Invitation, error)

	DeleteInvitation(ctx UserContext, accountName string, invitationId repos.ID) (bool, error)

	AcceptInvitation(ctx UserContext, accountName string, inviteToken string) (bool, error)
	RejectInvitation(ctx UserContext, accountName string, inviteToken string) (bool, error)
}

type MembershipService

type MembershipService interface {
	ListMembershipsForUser(ctx UserContext) ([]*entities.AccountMembership, error)
	ListMembershipsForAccount(ctx UserContext, accountName string, role *iamT.Role) ([]*entities.AccountMembership, error)

	GetAccountMembership(ctx UserContext, accountName string) (*entities.AccountMembership, error)

	RemoveAccountMembership(ctx UserContext, accountName string, memberId repos.ID) (bool, error)
	UpdateAccountMembership(ctx UserContext, accountName string, memberId repos.ID, role iamT.Role) (bool, error)
}

type UserContext

type UserContext struct {
	context.Context
	UserId    repos.ID
	UserName  string
	UserEmail string
}

Jump to

Keyboard shortcuts

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