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 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
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 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) (*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 ¶
Click to show internal directories.
Click to hide internal directories.