Documentation
¶
Index ¶
- Variables
- func CacheOrganizationLimits(orgID string, limits *pb.OrganizationLimits, readStartedAt time.Time, ...) error
- func EnsureAccountWithinLimits(ctx context.Context, usageService Service, accountID string, ...) error
- func EnsureOrganizationWithinLimits(ctx context.Context, usageService Service, organizationID string, ...) error
- func LimitViolationError(violations []*pb.LimitViolation) error
- func MarkOrganizationSyncedIfUnset(orgID string) error
- func ReconcileCanvasCount(orgID string, usageServiceCount int32)
- func RefreshOrganizationLimitsCache(ctx context.Context, usageService Service, orgID string) (*pb.OrganizationLimits, error)
- func SyncOrganization(ctx context.Context, usageService Service, orgID string) error
- func SyncOrganizationForce(ctx context.Context, usageService Service, orgID string) error
- type Service
- type SetupOrganizationDetails
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoBillingAccountCandidate = errors.New("organization has no billing account candidate")
View Source
var ErrUsageDisabled = errors.New("usage disabled")
Functions ¶
func CacheOrganizationLimits ¶
func EnsureOrganizationWithinLimits ¶
func EnsureOrganizationWithinLimits( ctx context.Context, usageService Service, organizationID string, state *pb.OrganizationState, canvas *pb.CanvasState, ) error
func LimitViolationError ¶
func LimitViolationError(violations []*pb.LimitViolation) error
func ReconcileCanvasCount ¶ added in v0.16.0
func SyncOrganization ¶
Types ¶
type Service ¶
type Service interface {
Enabled() bool
SetupAccount(ctx context.Context, accountID string) (*pb.SetupAccountResponse, error)
SetupOrganization(ctx context.Context, organizationID, accountID string, details SetupOrganizationDetails) (*pb.SetupOrganizationResponse, error)
DescribeAccountLimits(ctx context.Context, accountID string) (*pb.DescribeAccountLimitsResponse, error)
DescribeOrganizationLimits(ctx context.Context, organizationID string) (*pb.DescribeOrganizationLimitsResponse, error)
DescribeOrganizationUsage(ctx context.Context, organizationID string) (*pb.DescribeOrganizationUsageResponse, error)
CheckAccountLimits(ctx context.Context, accountID string, state *pb.AccountState) (*pb.CheckAccountLimitsResponse, error)
CheckOrganizationLimits(
ctx context.Context,
organizationID string,
state *pb.OrganizationState,
canvas *pb.CanvasState,
) (*pb.CheckOrganizationLimitsResponse, error)
}
func NewServiceFromEnv ¶
type SetupOrganizationDetails ¶ added in v0.19.0
type SetupOrganizationDetails struct {
CreatedByName string
CreatedByEmail string
OrganizationName string
}
SetupOrganizationDetails is metadata forwarded to the usage service (e.g. for notifications). Use the zero value when there is nothing extra to send.
Click to show internal directories.
Click to hide internal directories.