quotapb

package
v0.0.0-...-cf55a68 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package quotapb exports proto definitions required by the quota library.

Index

Constants

This section is empty.

Variables

View Source
var (
	Op_RelativeTo_name = map[int32]string{
		0: "CURRENT_BALANCE",
		1: "ZERO",
		2: "DEFAULT",
		3: "LIMIT",
	}
	Op_RelativeTo_value = map[string]int32{
		"CURRENT_BALANCE": 0,
		"ZERO":            1,
		"DEFAULT":         2,
		"LIMIT":           3,
	}
)

Enum value maps for Op_RelativeTo.

View Source
var (
	Op_Options_name = map[int32]string{
		0: "NO_OPTIONS",
		1: "IGNORE_POLICY_BOUNDS",
		2: "DO_NOT_CAP_PROPOSED",
		4: "WITH_POLICY_LIMIT_DELTA",
	}
	Op_Options_value = map[string]int32{
		"NO_OPTIONS":              0,
		"IGNORE_POLICY_BOUNDS":    1,
		"DO_NOT_CAP_PROPOSED":     2,
		"WITH_POLICY_LIMIT_DELTA": 4,
	}
)

Enum value maps for Op_Options.

View Source
var (
	Policy_Options_name = map[int32]string{
		0: "NO_OPTIONS",
		1: "ABSOLUTE_RESOURCE",
	}
	Policy_Options_value = map[string]int32{
		"NO_OPTIONS":        0,
		"ABSOLUTE_RESOURCE": 1,
	}
)

Enum value maps for Policy_Options.

View Source
var (
	OpResult_AccountStatus_name = map[int32]string{
		0: "ALREADY_EXISTS",
		1: "CREATED",
		2: "RECREATED",
	}
	OpResult_AccountStatus_value = map[string]int32{
		"ALREADY_EXISTS": 0,
		"CREATED":        1,
		"RECREATED":      2,
	}
)

Enum value maps for OpResult_AccountStatus.

View Source
var (
	OpResult_OpStatus_name = map[int32]string{
		0: "SUCCESS",
		1: "ERR_UNKNOWN",
		2: "ERR_OVERFLOW",
		3: "ERR_UNDERFLOW",
		4: "ERR_UNKNOWN_POLICY",
		5: "ERR_MISSING_ACCOUNT",
		6: "ERR_POLICY_REQUIRED",
	}
	OpResult_OpStatus_value = map[string]int32{
		"SUCCESS":             0,
		"ERR_UNKNOWN":         1,
		"ERR_OVERFLOW":        2,
		"ERR_UNDERFLOW":       3,
		"ERR_UNKNOWN_POLICY":  4,
		"ERR_MISSING_ACCOUNT": 5,
		"ERR_POLICY_REQUIRED": 6,
	}
)

Enum value maps for OpResult_OpStatus.

View Source
var File_go_chromium_org_luci_server_quota_quotapb_account_proto protoreflect.FileDescriptor
View Source
var File_go_chromium_org_luci_server_quota_quotapb_ids_proto protoreflect.FileDescriptor
View Source
var File_go_chromium_org_luci_server_quota_quotapb_op_proto protoreflect.FileDescriptor
View Source
var File_go_chromium_org_luci_server_quota_quotapb_policy_config_proto protoreflect.FileDescriptor
View Source
var File_go_chromium_org_luci_server_quota_quotapb_policy_proto protoreflect.FileDescriptor
View Source
var File_go_chromium_org_luci_server_quota_quotapb_request_entry_proto protoreflect.FileDescriptor
View Source
var File_go_chromium_org_luci_server_quota_quotapb_service_proto protoreflect.FileDescriptor
View Source
var File_go_chromium_org_luci_server_quota_quotapb_update_accounts_proto protoreflect.FileDescriptor

Functions

func FileDescriptorSet

func FileDescriptorSet() *descriptorpb.FileDescriptorSet

FileDescriptorSet returns a descriptor set for this proto package, which includes all defined services, and all transitive dependencies.

Will not return nil.

Do NOT modify the returned descriptor.

func RegisterAdminServer

func RegisterAdminServer(s prpc.Registrar, srv AdminServer)

Types

type Account

type Account struct {

	// The current numeric amount balance.
	//
	// NOTE: The odd-looking limits are because the current implementation uses
	// Lua5.1 (embedded in Redis) for quota accounting, which stores numbers as
	// doubles (making the maximum safe integer range only 53 bits). It would be
	// possible to address this limit with some work. If you have a need of an
	// account balance under/over these thresholds, please let us know.
	Balance int64 `protobuf:"varint,1,opt,name=balance,proto3" json:"balance,omitempty"`
	// The timestamp when the `balance` was last updated.
	//
	// This has microsecond accuracy (but note that refresh policies are only
	// calculated at one-second resolution).
	UpdatedTs *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=updated_ts,json=updatedTs,proto3" json:"updated_ts,omitempty"`
	// The timestamp when this account's policy last changed.
	//
	// This has microsecond accuracy.
	PolicyChangeTs *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=policy_change_ts,json=policyChangeTs,proto3" json:"policy_change_ts,omitempty"`
	// The ref for the Policy which currently applies to this Account.
	PolicyRef *PolicyRef `protobuf:"bytes,4,opt,name=policy_ref,json=policyRef,proto3" json:"policy_ref,omitempty"`
	// Snapshot of the Policy which currently applies to this Account.
	Policy *Policy `protobuf:"bytes,5,opt,name=policy,proto3" json:"policy,omitempty"`
	// contains filtered or unexported fields
}

An Account represents the current state of a single account.

Note that a given user will have an account for each resource type in each domain (realm, namespace) that they interact with. Each account tracks exactly one balance.

func (*Account) Descriptor deprecated

func (*Account) Descriptor() ([]byte, []int)

Deprecated: Use Account.ProtoReflect.Descriptor instead.

func (*Account) GetBalance

func (x *Account) GetBalance() int64

func (*Account) GetPolicy

func (x *Account) GetPolicy() *Policy

func (*Account) GetPolicyChangeTs

func (x *Account) GetPolicyChangeTs() *timestamppb.Timestamp

func (*Account) GetPolicyRef

func (x *Account) GetPolicyRef() *PolicyRef

func (*Account) GetUpdatedTs

func (x *Account) GetUpdatedTs() *timestamppb.Timestamp

func (*Account) ProtoMessage

func (*Account) ProtoMessage()

func (*Account) ProtoReflect

func (x *Account) ProtoReflect() protoreflect.Message

func (*Account) Reset

func (x *Account) Reset()

func (*Account) String

func (x *Account) String() string

func (*Account) Validate

func (m *Account) Validate() error

Validate checks the field values on Account with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Account) ValidateAll

func (m *Account) ValidateAll() error

ValidateAll checks the field values on Account with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in AccountMultiError, or nil if none found.

type AccountID

type AccountID struct {

	// The short application id.
	//
	// This is used to separate different applications in the same service
	// deployment.
	//
	// This should be a short indicator of what logical service this Account
	// applies to (like `cv` or `rdb`, not `luci-cv.appspot.com`).
	//
	// Examples:
	//
	//	cv
	//	rdb
	AppId string `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"`
	// The LUCI realm that the Account belongs to.
	//
	// This is a global realm string (i.e. includes the project).
	//
	// NOTE: This realm and the PolicyConfig realm will USUALLY NOT match. The
	// realm here is indicating the realm of the resource governed by this
	// Account.
	//
	// Examples:
	//
	//	chromium:ci
	//	@internal:<LUCI service-name>
	Realm string `protobuf:"bytes,2,opt,name=realm,proto3" json:"realm,omitempty"`
	// The LUCI Auth identity that this Account belongs to, or "" if the account
	// is not owned by a specific identity.
	//
	// Identities look like:
	//   - anonymous:anonymous
	//   - bot:...
	//   - project:...
	//   - service:...
	//   - user:...
	Identity string `protobuf:"bytes,3,opt,name=identity,proto3" json:"identity,omitempty"`
	// The namespace of the Account (ASI).
	//
	// Used by the application to logically separate multiple account groups
	// within the same realm.
	//
	// Examples:
	//
	//	cqGroupName
	//	RPCService.RPCName
	Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// The name of the Account (ASI).
	//
	// This may be empty (e.g. if the account is sufficiently identitified by
	// realm/identity/namespace, etc).
	//
	// Examples:
	//
	//	"sharedAccountName"
	//	""
	Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"`
	// The type of resource managed by this account.
	//
	// Examples:
	//
	//	qps
	//	runningBuilds
	ResourceType string `protobuf:"bytes,6,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"`
	// contains filtered or unexported fields
}

Identifies a single Account.

func (*AccountID) Descriptor deprecated

func (*AccountID) Descriptor() ([]byte, []int)

Deprecated: Use AccountID.ProtoReflect.Descriptor instead.

func (*AccountID) GetAppId

func (x *AccountID) GetAppId() string

func (*AccountID) GetIdentity

func (x *AccountID) GetIdentity() string

func (*AccountID) GetName

func (x *AccountID) GetName() string

func (*AccountID) GetNamespace

func (x *AccountID) GetNamespace() string

func (*AccountID) GetRealm

func (x *AccountID) GetRealm() string

func (*AccountID) GetResourceType

func (x *AccountID) GetResourceType() string

func (*AccountID) ProtoMessage

func (*AccountID) ProtoMessage()

func (*AccountID) ProtoReflect

func (x *AccountID) ProtoReflect() protoreflect.Message

func (*AccountID) Reset

func (x *AccountID) Reset()

func (*AccountID) String

func (x *AccountID) String() string

func (*AccountID) Validate

func (m *AccountID) Validate() error

Validate checks the field values on AccountID with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*AccountID) ValidateAll

func (m *AccountID) ValidateAll() error

ValidateAll checks the field values on AccountID with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in AccountIDMultiError, or nil if none found.

type AccountIDMultiError

type AccountIDMultiError []error

AccountIDMultiError is an error wrapping multiple validation errors returned by AccountID.ValidateAll() if the designated constraints aren't met.

func (AccountIDMultiError) AllErrors

func (m AccountIDMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (AccountIDMultiError) Error

func (m AccountIDMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type AccountIDValidationError

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

AccountIDValidationError is the validation error returned by AccountID.Validate if the designated constraints aren't met.

func (AccountIDValidationError) Cause

func (e AccountIDValidationError) Cause() error

Cause function returns cause value.

func (AccountIDValidationError) Error

func (e AccountIDValidationError) Error() string

Error satisfies the builtin error interface

func (AccountIDValidationError) ErrorName

func (e AccountIDValidationError) ErrorName() string

ErrorName returns error name.

func (AccountIDValidationError) Field

func (e AccountIDValidationError) Field() string

Field function returns field value.

func (AccountIDValidationError) Key

Key function returns key value.

func (AccountIDValidationError) Reason

func (e AccountIDValidationError) Reason() string

Reason function returns reason value.

type AccountMultiError

type AccountMultiError []error

AccountMultiError is an error wrapping multiple validation errors returned by Account.ValidateAll() if the designated constraints aren't met.

func (AccountMultiError) AllErrors

func (m AccountMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (AccountMultiError) Error

func (m AccountMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type AccountValidationError

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

AccountValidationError is the validation error returned by Account.Validate if the designated constraints aren't met.

func (AccountValidationError) Cause

func (e AccountValidationError) Cause() error

Cause function returns cause value.

func (AccountValidationError) Error

func (e AccountValidationError) Error() string

Error satisfies the builtin error interface

func (AccountValidationError) ErrorName

func (e AccountValidationError) ErrorName() string

ErrorName returns error name.

func (AccountValidationError) Field

func (e AccountValidationError) Field() string

Field function returns field value.

func (AccountValidationError) Key

func (e AccountValidationError) Key() bool

Key function returns key value.

func (AccountValidationError) Reason

func (e AccountValidationError) Reason() string

Reason function returns reason value.

type AdminClient

type AdminClient interface {
	// GetAccounts returns the indicated Accounts.
	GetAccounts(ctx context.Context, in *GetAccountsRequest, opts ...grpc.CallOption) (*GetAccountsResponse, error)
	// ApplyOps updates the available resources with the provided operations.
	ApplyOps(ctx context.Context, in *ApplyOpsRequest, opts ...grpc.CallOption) (*ApplyOpsResponse, error)
	// WritePolicyConfig ingests the given PolicyConfig into the database.
	WritePolicyConfig(ctx context.Context, in *WritePolicyConfigRequest, opts ...grpc.CallOption) (*WritePolicyConfigResponse, error)
}

AdminClient is the client API for Admin service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewAdminClient

func NewAdminClient(cc grpc.ClientConnInterface) AdminClient

func NewAdminPRPCClient

func NewAdminPRPCClient(client *prpc.Client) AdminClient

type AdminServer

type AdminServer interface {
	// GetAccounts returns the indicated Accounts.
	GetAccounts(context.Context, *GetAccountsRequest) (*GetAccountsResponse, error)
	// ApplyOps updates the available resources with the provided operations.
	ApplyOps(context.Context, *ApplyOpsRequest) (*ApplyOpsResponse, error)
	// WritePolicyConfig ingests the given PolicyConfig into the database.
	WritePolicyConfig(context.Context, *WritePolicyConfigRequest) (*WritePolicyConfigResponse, error)
}

AdminServer is the server API for Admin service.

type ApplyOpsRequest

type ApplyOpsRequest struct {

	// If provided, the service will de-duplicate the request based on this ID,
	// namespaced to the calling user.
	//
	// Once this ApplyOpsRequest successfully applies once, futher ApplyOpsRequests
	// within `request_id_ttl` will immediately return as successful.
	RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// Must be set, and positive, if request_id is set.
	//
	// If this is omitted, the request_id_ttl is 2 hours.
	//
	// If this is zero, the request_id_ttl is infinite.
	RequestIdTtl *durationpb.Duration `protobuf:"bytes,2,opt,name=request_id_ttl,json=requestIdTtl,proto3" json:"request_id_ttl,omitempty"`
	// The operations to apply.
	Ops []*Op `protobuf:"bytes,3,rep,name=ops,proto3" json:"ops,omitempty"`
	// contains filtered or unexported fields
}

ApplyOpsRequest allows a number of quota operations to be performed atomically.

func (*ApplyOpsRequest) Descriptor deprecated

func (*ApplyOpsRequest) Descriptor() ([]byte, []int)

Deprecated: Use ApplyOpsRequest.ProtoReflect.Descriptor instead.

func (*ApplyOpsRequest) GetOps

func (x *ApplyOpsRequest) GetOps() []*Op

func (*ApplyOpsRequest) GetRequestId

func (x *ApplyOpsRequest) GetRequestId() string

func (*ApplyOpsRequest) GetRequestIdTtl

func (x *ApplyOpsRequest) GetRequestIdTtl() *durationpb.Duration

func (*ApplyOpsRequest) ProtoMessage

func (*ApplyOpsRequest) ProtoMessage()

func (*ApplyOpsRequest) ProtoReflect

func (x *ApplyOpsRequest) ProtoReflect() protoreflect.Message

func (*ApplyOpsRequest) Reset

func (x *ApplyOpsRequest) Reset()

func (*ApplyOpsRequest) String

func (x *ApplyOpsRequest) String() string

func (*ApplyOpsRequest) Validate

func (m *ApplyOpsRequest) Validate() error

Validate checks the field values on ApplyOpsRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ApplyOpsRequest) ValidateAll

func (m *ApplyOpsRequest) ValidateAll() error

ValidateAll checks the field values on ApplyOpsRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ApplyOpsRequestMultiError, or nil if none found.

type ApplyOpsRequestMultiError

type ApplyOpsRequestMultiError []error

ApplyOpsRequestMultiError is an error wrapping multiple validation errors returned by ApplyOpsRequest.ValidateAll() if the designated constraints aren't met.

func (ApplyOpsRequestMultiError) AllErrors

func (m ApplyOpsRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ApplyOpsRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type ApplyOpsRequestValidationError

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

ApplyOpsRequestValidationError is the validation error returned by ApplyOpsRequest.Validate if the designated constraints aren't met.

func (ApplyOpsRequestValidationError) Cause

Cause function returns cause value.

func (ApplyOpsRequestValidationError) Error

Error satisfies the builtin error interface

func (ApplyOpsRequestValidationError) ErrorName

func (e ApplyOpsRequestValidationError) ErrorName() string

ErrorName returns error name.

func (ApplyOpsRequestValidationError) Field

Field function returns field value.

func (ApplyOpsRequestValidationError) Key

Key function returns key value.

func (ApplyOpsRequestValidationError) Reason

Reason function returns reason value.

type ApplyOpsResponse

type ApplyOpsResponse struct {

	// This is a sequence of results, one per op in the original ApplyOpsRequest.
	//
	// NOTE: The caller must observe the `status` field of each result in order to
	// determine if this request was successful.
	//
	// If any result contains a non-SUCCESS `status`, NONE of the operations have
	// been saved.
	Results []*OpResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
	// The time this ApplyOpsResponse was created, according to the quota state.
	// Note that for deduplicated requests, this could be fairly old (assuming the
	// original request was made a while ago).
	OriginallySet *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=originally_set,json=originallySet,proto3" json:"originally_set,omitempty"`
	// contains filtered or unexported fields
}

func (*ApplyOpsResponse) Descriptor deprecated

func (*ApplyOpsResponse) Descriptor() ([]byte, []int)

Deprecated: Use ApplyOpsResponse.ProtoReflect.Descriptor instead.

func (*ApplyOpsResponse) GetOriginallySet

func (x *ApplyOpsResponse) GetOriginallySet() *timestamppb.Timestamp

func (*ApplyOpsResponse) GetResults

func (x *ApplyOpsResponse) GetResults() []*OpResult

func (*ApplyOpsResponse) ProtoMessage

func (*ApplyOpsResponse) ProtoMessage()

func (*ApplyOpsResponse) ProtoReflect

func (x *ApplyOpsResponse) ProtoReflect() protoreflect.Message

func (*ApplyOpsResponse) Reset

func (x *ApplyOpsResponse) Reset()

func (*ApplyOpsResponse) String

func (x *ApplyOpsResponse) String() string

func (*ApplyOpsResponse) Validate

func (m *ApplyOpsResponse) Validate() error

Validate checks the field values on ApplyOpsResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ApplyOpsResponse) ValidateAll

func (m *ApplyOpsResponse) ValidateAll() error

ValidateAll checks the field values on ApplyOpsResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ApplyOpsResponseMultiError, or nil if none found.

type ApplyOpsResponseMultiError

type ApplyOpsResponseMultiError []error

ApplyOpsResponseMultiError is an error wrapping multiple validation errors returned by ApplyOpsResponse.ValidateAll() if the designated constraints aren't met.

func (ApplyOpsResponseMultiError) AllErrors

func (m ApplyOpsResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ApplyOpsResponseMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type ApplyOpsResponseValidationError

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

ApplyOpsResponseValidationError is the validation error returned by ApplyOpsResponse.Validate if the designated constraints aren't met.

func (ApplyOpsResponseValidationError) Cause

Cause function returns cause value.

func (ApplyOpsResponseValidationError) Error

Error satisfies the builtin error interface

func (ApplyOpsResponseValidationError) ErrorName

ErrorName returns error name.

func (ApplyOpsResponseValidationError) Field

Field function returns field value.

func (ApplyOpsResponseValidationError) Key

Key function returns key value.

func (ApplyOpsResponseValidationError) Reason

Reason function returns reason value.

type GetAccountsRequest

type GetAccountsRequest struct {

	// A list of specific accounts to fetch.
	Account []*AccountID `protobuf:"bytes,1,rep,name=account,proto3" json:"account,omitempty"`
	// contains filtered or unexported fields
}

A GetAccountsRequest is a request to fetch multiple Account entries.

You must have the `quota.accounts.read` permission in the realm of all the indicated accounts.

func (*GetAccountsRequest) Descriptor deprecated

func (*GetAccountsRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetAccountsRequest.ProtoReflect.Descriptor instead.

func (*GetAccountsRequest) GetAccount

func (x *GetAccountsRequest) GetAccount() []*AccountID

func (*GetAccountsRequest) ProtoMessage

func (*GetAccountsRequest) ProtoMessage()

func (*GetAccountsRequest) ProtoReflect

func (x *GetAccountsRequest) ProtoReflect() protoreflect.Message

func (*GetAccountsRequest) Reset

func (x *GetAccountsRequest) Reset()

func (*GetAccountsRequest) String

func (x *GetAccountsRequest) String() string

func (*GetAccountsRequest) Validate

func (m *GetAccountsRequest) Validate() error

Validate checks the field values on GetAccountsRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GetAccountsRequest) ValidateAll

func (m *GetAccountsRequest) ValidateAll() error

ValidateAll checks the field values on GetAccountsRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetAccountsRequestMultiError, or nil if none found.

type GetAccountsRequestMultiError

type GetAccountsRequestMultiError []error

GetAccountsRequestMultiError is an error wrapping multiple validation errors returned by GetAccountsRequest.ValidateAll() if the designated constraints aren't met.

func (GetAccountsRequestMultiError) AllErrors

func (m GetAccountsRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetAccountsRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type GetAccountsRequestValidationError

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

GetAccountsRequestValidationError is the validation error returned by GetAccountsRequest.Validate if the designated constraints aren't met.

func (GetAccountsRequestValidationError) Cause

Cause function returns cause value.

func (GetAccountsRequestValidationError) Error

Error satisfies the builtin error interface

func (GetAccountsRequestValidationError) ErrorName

ErrorName returns error name.

func (GetAccountsRequestValidationError) Field

Field function returns field value.

func (GetAccountsRequestValidationError) Key

Key function returns key value.

func (GetAccountsRequestValidationError) Reason

Reason function returns reason value.

type GetAccountsResponse

type GetAccountsResponse struct {
	Accounts []*GetAccountsResponse_AccountState `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"`
	// contains filtered or unexported fields
}

GetAccountsResponse is the response to GetAccounts()

func (*GetAccountsResponse) Descriptor deprecated

func (*GetAccountsResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetAccountsResponse.ProtoReflect.Descriptor instead.

func (*GetAccountsResponse) GetAccounts

func (*GetAccountsResponse) ProtoMessage

func (*GetAccountsResponse) ProtoMessage()

func (*GetAccountsResponse) ProtoReflect

func (x *GetAccountsResponse) ProtoReflect() protoreflect.Message

func (*GetAccountsResponse) Reset

func (x *GetAccountsResponse) Reset()

func (*GetAccountsResponse) String

func (x *GetAccountsResponse) String() string

func (*GetAccountsResponse) Validate

func (m *GetAccountsResponse) Validate() error

Validate checks the field values on GetAccountsResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GetAccountsResponse) ValidateAll

func (m *GetAccountsResponse) ValidateAll() error

ValidateAll checks the field values on GetAccountsResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetAccountsResponseMultiError, or nil if none found.

type GetAccountsResponseMultiError

type GetAccountsResponseMultiError []error

GetAccountsResponseMultiError is an error wrapping multiple validation errors returned by GetAccountsResponse.ValidateAll() if the designated constraints aren't met.

func (GetAccountsResponseMultiError) AllErrors

func (m GetAccountsResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetAccountsResponseMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type GetAccountsResponseValidationError

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

GetAccountsResponseValidationError is the validation error returned by GetAccountsResponse.Validate if the designated constraints aren't met.

func (GetAccountsResponseValidationError) Cause

Cause function returns cause value.

func (GetAccountsResponseValidationError) Error

Error satisfies the builtin error interface

func (GetAccountsResponseValidationError) ErrorName

ErrorName returns error name.

func (GetAccountsResponseValidationError) Field

Field function returns field value.

func (GetAccountsResponseValidationError) Key

Key function returns key value.

func (GetAccountsResponseValidationError) Reason

Reason function returns reason value.

type GetAccountsResponse_AccountState

type GetAccountsResponse_AccountState struct {
	Id *AccountID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The current account, if the account exists, unset otherwise.
	Account *Account `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"`
	// Contains the effective balance for the account, given its current
	// refill policy and updated_ts.
	ProjectedBalance int64 `protobuf:"varint,3,opt,name=projected_balance,json=projectedBalance,proto3" json:"projected_balance,omitempty"`
	// contains filtered or unexported fields
}

func (*GetAccountsResponse_AccountState) Descriptor deprecated

func (*GetAccountsResponse_AccountState) Descriptor() ([]byte, []int)

Deprecated: Use GetAccountsResponse_AccountState.ProtoReflect.Descriptor instead.

func (*GetAccountsResponse_AccountState) GetAccount

func (x *GetAccountsResponse_AccountState) GetAccount() *Account

func (*GetAccountsResponse_AccountState) GetId

func (*GetAccountsResponse_AccountState) GetProjectedBalance

func (x *GetAccountsResponse_AccountState) GetProjectedBalance() int64

func (*GetAccountsResponse_AccountState) ProtoMessage

func (*GetAccountsResponse_AccountState) ProtoMessage()

func (*GetAccountsResponse_AccountState) ProtoReflect

func (*GetAccountsResponse_AccountState) Reset

func (*GetAccountsResponse_AccountState) String

func (*GetAccountsResponse_AccountState) Validate

Validate checks the field values on GetAccountsResponse_AccountState with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GetAccountsResponse_AccountState) ValidateAll

func (m *GetAccountsResponse_AccountState) ValidateAll() error

ValidateAll checks the field values on GetAccountsResponse_AccountState with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetAccountsResponse_AccountStateMultiError, or nil if none found.

type GetAccountsResponse_AccountStateMultiError

type GetAccountsResponse_AccountStateMultiError []error

GetAccountsResponse_AccountStateMultiError is an error wrapping multiple validation errors returned by GetAccountsResponse_AccountState.ValidateAll() if the designated constraints aren't met.

func (GetAccountsResponse_AccountStateMultiError) AllErrors

AllErrors returns a list of validation violation errors.

func (GetAccountsResponse_AccountStateMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type GetAccountsResponse_AccountStateValidationError

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

GetAccountsResponse_AccountStateValidationError is the validation error returned by GetAccountsResponse_AccountState.Validate if the designated constraints aren't met.

func (GetAccountsResponse_AccountStateValidationError) Cause

Cause function returns cause value.

func (GetAccountsResponse_AccountStateValidationError) Error

Error satisfies the builtin error interface

func (GetAccountsResponse_AccountStateValidationError) ErrorName

ErrorName returns error name.

func (GetAccountsResponse_AccountStateValidationError) Field

Field function returns field value.

func (GetAccountsResponse_AccountStateValidationError) Key

Key function returns key value.

func (GetAccountsResponse_AccountStateValidationError) Reason

Reason function returns reason value.

type Op

type Op struct {

	// The Account to adjust the value for.
	AccountId *AccountID `protobuf:"bytes,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"`
	// The policy under which to adjust the account balance.
	//
	// If the policy is not specified, this will use the Policy already set on the
	// Account.
	//
	// If the Account doesn't already exist, this Op will fail with an error of
	// status MISSING_ACCOUNT, unless relative_to is ZERO.
	PolicyId *PolicyID `protobuf:"bytes,2,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"`
	// The value that `delta` is relative to, when calculating the new balance.
	RelativeTo Op_RelativeTo `` /* 153-byte string literal not displayed */
	// Delta is the number of units to add (or subtract) from the `relative_to` to
	// get a new `proposed` balance for the given Account.
	//
	// If `proposed` would bring a positive Account balance below 0, this will an
	// error with status UNDERFLOW.
	//   - IGNORE_POLICY_BOUNDS will allow this Op to bring the Account balance
	//     negative.
	//
	// If `proposed` would set the Account balance above Policy.limit, this will
	// instead set the Account balance to Policy.limit.
	//   - IGNORE_POLICY_BOUNDS will allow this Op to set the Account balance above
	//     Policy.limit.
	//   - DO_NOT_CAP_PROPOSED will cause this to be an error with status OVERFLOW.
	//
	// Adding to an account with a negative balance is OK, and will increase the
	// balance by the given amount (subject to the rules above).
	// Subtracting from an account with an over-limit balance is OK, and will
	// decrease the balance by the given amount (subject to the rules above).
	//
	// Ops with relative_to CURRENT_BALANCE or ZERO and no Policy set have no
	// boundaries (i.e. value can drop below zero or go all the way up to the
	// maximum balance without issue).
	//
	// Note that Ops with `delta == 0` are legitimate, for example:
	//   - as a means to apply a new policy without explicitly modifying
	//     the balance.
	//   - as a means to recalculate and save a refill policy value (note that
	//     this should not effect the observed value of the balance; e.g. delta:
	//     0 followed by delta: 1 at the same time will have the same cumulative
	//     effect as just delta: 1)
	//   - as a means to 'touch' an active account, resetting its updated_ts
	//     time and any potential expiration timer.
	Delta int64 `protobuf:"varint,4,opt,name=delta,proto3" json:"delta,omitempty"`
	// Bitwise-OR of Options values.
	Options uint32 `protobuf:"varint,5,opt,name=options,proto3" json:"options,omitempty"`
	// contains filtered or unexported fields
}

A single operation to apply to the quota state.

NOTE: Keep in sync with RawOp, which is the type which is actually passed to the update lua script.

func (*Op) Descriptor deprecated

func (*Op) Descriptor() ([]byte, []int)

Deprecated: Use Op.ProtoReflect.Descriptor instead.

func (*Op) GetAccountId

func (x *Op) GetAccountId() *AccountID

func (*Op) GetDelta

func (x *Op) GetDelta() int64

func (*Op) GetOptions

func (x *Op) GetOptions() uint32

func (*Op) GetPolicyId

func (x *Op) GetPolicyId() *PolicyID

func (*Op) GetRelativeTo

func (x *Op) GetRelativeTo() Op_RelativeTo

func (*Op) ProtoMessage

func (*Op) ProtoMessage()

func (*Op) ProtoReflect

func (x *Op) ProtoReflect() protoreflect.Message

func (*Op) Reset

func (x *Op) Reset()

func (*Op) String

func (x *Op) String() string

func (*Op) Validate

func (m *Op) Validate() error

Validate checks the field values on Op with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Op) ValidateAll

func (m *Op) ValidateAll() error

ValidateAll checks the field values on Op with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in OpMultiError, or nil if none found.

type OpMultiError

type OpMultiError []error

OpMultiError is an error wrapping multiple validation errors returned by Op.ValidateAll() if the designated constraints aren't met.

func (OpMultiError) AllErrors

func (m OpMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (OpMultiError) Error

func (m OpMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type OpResult

type OpResult struct {

	// This will be set to the balance of the Account after the SUCCESS-ful
	// operation.
	NewBalance int64 `protobuf:"varint,1,opt,name=new_balance,json=newBalance,proto3" json:"new_balance,omitempty"`
	// If the account already existed, this will be set to the balance observed at
	// the start of this Operation (after applying refill under existing policy,
	// if the account had one set). If the account did not previously exist, this
	// will be 0, even if the Policy in this Op would set a default value.
	//
	// Note that if the same account is used for multiple operations in the same
	// RPC, for the N'th operation on account X, this will have the N-1'th
	// `balance` value.
	PreviousBalance int64                  `protobuf:"varint,2,opt,name=previous_balance,json=previousBalance,proto3" json:"previous_balance,omitempty"`
	AccountStatus   OpResult_AccountStatus `` /* 171-byte string literal not displayed */
	// Status for this operation.
	Status OpResult_OpStatus `` /* 131-byte string literal not displayed */
	// Extra context for `status` as english text. Usually unset, but will be most
	// frequently set for UNKNOWN errors.
	StatusMsg string `protobuf:"bytes,5,opt,name=status_msg,json=statusMsg,proto3" json:"status_msg,omitempty"`
	// When WITH_POLICY_LIMIT_DELTA option is used, previous_balance_adjusted is
	// set to the previous balance + delta (where delta is the difference between
	// the new Policy.limit and the old Policy.limit). If WITH_POLICY_LIMIT_DELTA
	// is not set or if there is no change in policy_ref, or if the account has no
	// existing policy_ref, previous_balance_adjusted is same as previous_balance.
	PreviousBalanceAdjusted int64 `` /* 133-byte string literal not displayed */
	// contains filtered or unexported fields
}

OpResult contains the summary of applying a single Op as part of an ApplyOpsRequest.

Note that `previous_balance` and `balance` are first in this message to make the success-case encoding of an OpResult with non-zero balances as compact as possible (will be represented by a 2-number msgpack array, rather than a msgpack object).

func (*OpResult) Descriptor deprecated

func (*OpResult) Descriptor() ([]byte, []int)

Deprecated: Use OpResult.ProtoReflect.Descriptor instead.

func (*OpResult) GetAccountStatus

func (x *OpResult) GetAccountStatus() OpResult_AccountStatus

func (*OpResult) GetNewBalance

func (x *OpResult) GetNewBalance() int64

func (*OpResult) GetPreviousBalance

func (x *OpResult) GetPreviousBalance() int64

func (*OpResult) GetPreviousBalanceAdjusted

func (x *OpResult) GetPreviousBalanceAdjusted() int64

func (*OpResult) GetStatus

func (x *OpResult) GetStatus() OpResult_OpStatus

func (*OpResult) GetStatusMsg

func (x *OpResult) GetStatusMsg() string

func (*OpResult) ProtoMessage

func (*OpResult) ProtoMessage()

func (*OpResult) ProtoReflect

func (x *OpResult) ProtoReflect() protoreflect.Message

func (*OpResult) Reset

func (x *OpResult) Reset()

func (*OpResult) String

func (x *OpResult) String() string

func (*OpResult) Validate

func (m *OpResult) Validate() error

Validate checks the field values on OpResult with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*OpResult) ValidateAll

func (m *OpResult) ValidateAll() error

ValidateAll checks the field values on OpResult with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in OpResultMultiError, or nil if none found.

type OpResultMultiError

type OpResultMultiError []error

OpResultMultiError is an error wrapping multiple validation errors returned by OpResult.ValidateAll() if the designated constraints aren't met.

func (OpResultMultiError) AllErrors

func (m OpResultMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (OpResultMultiError) Error

func (m OpResultMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type OpResultValidationError

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

OpResultValidationError is the validation error returned by OpResult.Validate if the designated constraints aren't met.

func (OpResultValidationError) Cause

func (e OpResultValidationError) Cause() error

Cause function returns cause value.

func (OpResultValidationError) Error

func (e OpResultValidationError) Error() string

Error satisfies the builtin error interface

func (OpResultValidationError) ErrorName

func (e OpResultValidationError) ErrorName() string

ErrorName returns error name.

func (OpResultValidationError) Field

func (e OpResultValidationError) Field() string

Field function returns field value.

func (OpResultValidationError) Key

func (e OpResultValidationError) Key() bool

Key function returns key value.

func (OpResultValidationError) Reason

func (e OpResultValidationError) Reason() string

Reason function returns reason value.

type OpResult_AccountStatus

type OpResult_AccountStatus int32
const (
	// This Op updated an existing account.
	OpResult_ALREADY_EXISTS OpResult_AccountStatus = 0
	// This Op resulted in the creation of an account.
	OpResult_CREATED OpResult_AccountStatus = 1
	// This Op found an existing, unreadable, account, and the account was
	// recreated (as if it were missing).
	//
	// Note that this is supposed to be a rare condition, and will be monitored
	// on the server side. If seen at elevated rates, this is likely alertable.
	OpResult_RECREATED OpResult_AccountStatus = 2
)

func (OpResult_AccountStatus) Descriptor

func (OpResult_AccountStatus) Enum

func (OpResult_AccountStatus) EnumDescriptor deprecated

func (OpResult_AccountStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use OpResult_AccountStatus.Descriptor instead.

func (OpResult_AccountStatus) Number

func (OpResult_AccountStatus) String

func (x OpResult_AccountStatus) String() string

func (OpResult_AccountStatus) Type

type OpResult_OpStatus

type OpResult_OpStatus int32
const (
	// The Operation was successful.
	OpResult_SUCCESS OpResult_OpStatus = 0
	// There was an otherwise-unclassified error while applying this operation.
	OpResult_ERR_UNKNOWN OpResult_OpStatus = 1
	// The Op failed because it would bring the Account balance above the policy
	// limit.
	OpResult_ERR_OVERFLOW OpResult_OpStatus = 2
	// The Op failed because it would bring the Account balance below 0.
	OpResult_ERR_UNDERFLOW OpResult_OpStatus = 3
	// The Op failed because it referred to a Policy which doesn't exist.
	OpResult_ERR_UNKNOWN_POLICY OpResult_OpStatus = 4
	// The Op failed because it applied to a non-existant Account and no Policy
	// was given.
	OpResult_ERR_MISSING_ACCOUNT OpResult_OpStatus = 5
	// The Op failed because it used relative_to=DEFAULT or LIMIT, but the Account
	// had no Policy attached to it, or if the Op did not include the
	// IGNORE_POLICY_BOUNDS option.
	OpResult_ERR_POLICY_REQUIRED OpResult_OpStatus = 6
)

func (OpResult_OpStatus) Descriptor

func (OpResult_OpStatus) Enum

func (OpResult_OpStatus) EnumDescriptor deprecated

func (OpResult_OpStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use OpResult_OpStatus.Descriptor instead.

func (OpResult_OpStatus) Number

func (OpResult_OpStatus) String

func (x OpResult_OpStatus) String() string

func (OpResult_OpStatus) Type

type OpValidationError

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

OpValidationError is the validation error returned by Op.Validate if the designated constraints aren't met.

func (OpValidationError) Cause

func (e OpValidationError) Cause() error

Cause function returns cause value.

func (OpValidationError) Error

func (e OpValidationError) Error() string

Error satisfies the builtin error interface

func (OpValidationError) ErrorName

func (e OpValidationError) ErrorName() string

ErrorName returns error name.

func (OpValidationError) Field

func (e OpValidationError) Field() string

Field function returns field value.

func (OpValidationError) Key

func (e OpValidationError) Key() bool

Key function returns key value.

func (OpValidationError) Reason

func (e OpValidationError) Reason() string

Reason function returns reason value.

type Op_Options

type Op_Options int32

NOTE: Options is a collection of bit-field values, not a standard enum.

const (
	// Default value; no implied behavior change.
	Op_NO_OPTIONS Op_Options = 0
	// If set, this Op can bring the account balance out of bounds; A positive
	// Delta will be allowed to bring the account balance above the
	// Policy.limit, and a negative Delta will be allowed to bring the account
	// balance below zero.
	//
	// NOTE: Regardless of this setting, Refill will never cause an Account to
	// go out of [0, Policy.limit], or cause an Account already in such a state
	// to go MORE out of bounds. This option only affects the behavior of `delta`.
	//
	// REQUIRED to do an operation on an Account with no associated Policy.
	//
	// Mutually exclusive with DO_NOT_CAP_PROPOSED.
	Op_IGNORE_POLICY_BOUNDS Op_Options = 1
	// If set, and this Op's positive delta would be capped by the policy limit,
	// AND the new value would be greater than the current balance, this Op will
	// produce an error with status OVERFLOW.
	//
	// For example, if the account has a value 10 with a limit of 15, normally
	// an Op{CURRENT_BALANCE, +10} would result in a balance of 15, but if it
	// instead had this bit set, the Op would error out.
	//
	// Additionally, if an account has a value 20, with a limit of 10, normally
	// an Op{CURRENT_BALANCE, -5} would result in a balance of 10 (the limit),
	// but if it instead had this bit set, the Op would result in a balance of
	// 15.
	//
	// Mutually exclusive with IGNORE_POLICY_BOUNDS.
	// No-op for Ops with delta <= 0.
	Op_DO_NOT_CAP_PROPOSED Op_Options = 2
	// If set, and if this Op introduces a policy change, i.e., it contains a
	// different policy_ref than what the account currently uses, the delta
	// between the new Policy.limit and old Policy.limit will be added to the
	// account's current balance. If the account has no existing policy_ref,
	// WITH_POLICY_LIMIT_DELTA is a noop.
	//
	// For example, if an account has a value of 3 with a limit of 5, and
	// the new policy_ref in this Op has a limit of 10, the account's value
	// with be updated to 8 (3 + delta, where delta = 10 - 5) before the Op is
	// applied. Similarly, if the limit were updated to 1 from 5, the account's
	// value will be updated to -1 (3 + delta, where delta = 1 - 5) before the
	// Op is applied.
	//
	// NOTE: IGNORE_POLICY_BOUNDS still works as documented if this option is
	// set, and WITH_POLICY_LIMIT_DELTA takes the balance below zero.
	Op_WITH_POLICY_LIMIT_DELTA Op_Options = 4 // Next entry is 8.
)

func (Op_Options) Descriptor

func (Op_Options) Descriptor() protoreflect.EnumDescriptor

func (Op_Options) Enum

func (x Op_Options) Enum() *Op_Options

func (Op_Options) EnumDescriptor deprecated

func (Op_Options) EnumDescriptor() ([]byte, []int)

Deprecated: Use Op_Options.Descriptor instead.

func (Op_Options) Number

func (x Op_Options) Number() protoreflect.EnumNumber

func (Op_Options) String

func (x Op_Options) String() string

func (Op_Options) Type

type Op_RelativeTo

type Op_RelativeTo int32
const (
	// This will apply Delta by adding it to the Account's current balance.
	//
	// Note that if the Account is new, and `policy_ref` was omitted, this will
	// fail with an error status MISSING_ACCOUNT.
	Op_CURRENT_BALANCE Op_RelativeTo = 0
	// This will apply Delta by adding it to zero; This effectively allows you
	// to 'set' an Account to some specific value.
	Op_ZERO Op_RelativeTo = 1
	// This will apply Delta by adding it to the policy `default` value.
	//
	// This uses the `default` field of the Account's current policy, if
	// `policy` on this Op is omitted. Otherwise this will use the `default`
	// field of the new policy.
	//
	// It is an error to use this RelativeTo value with an Account containing no
	// Policy, and this will result in an error status of POLICY_REQUIRED.
	Op_DEFAULT Op_RelativeTo = 2
	// This will apply Delta by adding it to the policy `limit` value.
	// Usually this is used with a negative Delta.
	//
	// This uses the `limit` field of the Account's current policy, if
	// `limit` on this Op is omitted. Otherwise this will use the `limit`
	// field of the new policy.
	//
	// It is an error to use this RelativeTo value with an Account containing no
	// Policy, and this will result in an error status of POLICY_REQUIRED.
	Op_LIMIT Op_RelativeTo = 3
)

func (Op_RelativeTo) Descriptor

func (Op_RelativeTo) Enum

func (x Op_RelativeTo) Enum() *Op_RelativeTo

func (Op_RelativeTo) EnumDescriptor deprecated

func (Op_RelativeTo) EnumDescriptor() ([]byte, []int)

Deprecated: Use Op_RelativeTo.Descriptor instead.

func (Op_RelativeTo) Number

func (Op_RelativeTo) String

func (x Op_RelativeTo) String() string

func (Op_RelativeTo) Type

type Policy

type Policy struct {

	// The number of resources to assign to an Account when first accessed under
	// this Policy.
	//
	// Must be <= `limit`.
	Default uint64 `protobuf:"varint,1,opt,name=default,proto3" json:"default,omitempty"`
	// The maximum balance of Accounts managed under this Policy.
	//
	// Operations with a positive delta will be capped to this value, unless they
	// specify `POLICY_HARD_LIMIT`, in which case exceeding this limit will be an
	// error.
	//
	// If this policy has a positive refill, accounts with this policy will
	// gradually fill to this limit over time (but will never refill past it).
	//
	// NOTE: When assigning a new Policy to an existing Account it's possible for
	// an Account balance to exceed this value.
	//
	// For example, say an Account had a balance of 100 under a Policy with
	// a limit of 100, but then you set a new Policy with a limit of 50. In this
	// case, the Account balance remains at 100. However, the Account would not
	// gain any additional refill under the new Policy until it was brought below
	// 50 (the new limit).
	//
	// This is done because applications using the quota library may not have full
	// consistency with their Policy choice (e.g. they may choose a Policy based
	// on group membership, which is volatile, or some application nodes may have
	// gotten configuration to use a new Policy version while others haven't).
	Limit  uint64         `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	Refill *Policy_Refill `protobuf:"bytes,3,opt,name=refill,proto3" json:"refill,omitempty"`
	// Bitwise-OR of Options values.
	Options int32 `protobuf:"varint,4,opt,name=options,proto3" json:"options,omitempty"`
	// The amount of time that Accounts created with this Policy should persist
	// after being written. Each Op on the Account refreshes the timeout.
	//
	// This could be used to create temporary quota Accounts based on e.g. IP
	// address which automatically garbage collect after a certain time.
	//
	// A value of 0 means an 'infinite' Account lifetime (the default).
	// It's recommended to pick some very large value for this rather than 0, to
	// allow Redis to prune old Accounts when it needs to do garbage collection.
	Lifetime *durationpb.Duration `protobuf:"bytes,5,opt,name=lifetime,proto3" json:"lifetime,omitempty"`
	// contains filtered or unexported fields
}

A Policy represents a single quota policy.

A single Policy will typically be used to govern many Accounts.

Policies are always loaded into the database within a PolicyConfig.

func (*Policy) Descriptor deprecated

func (*Policy) Descriptor() ([]byte, []int)

Deprecated: Use Policy.ProtoReflect.Descriptor instead.

func (*Policy) GetDefault

func (x *Policy) GetDefault() uint64

func (*Policy) GetLifetime

func (x *Policy) GetLifetime() *durationpb.Duration

func (*Policy) GetLimit

func (x *Policy) GetLimit() uint64

func (*Policy) GetOptions

func (x *Policy) GetOptions() int32

func (*Policy) GetRefill

func (x *Policy) GetRefill() *Policy_Refill

func (*Policy) ProtoMessage

func (*Policy) ProtoMessage()

func (*Policy) ProtoReflect

func (x *Policy) ProtoReflect() protoreflect.Message

func (*Policy) Reset

func (x *Policy) Reset()

func (*Policy) String

func (x *Policy) String() string

func (*Policy) Validate

func (m *Policy) Validate() error

Validate checks the field values on Policy with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Policy) ValidateAll

func (m *Policy) ValidateAll() error

ValidateAll checks the field values on Policy with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in PolicyMultiError, or nil if none found.

type PolicyConfig

type PolicyConfig struct {
	Policies []*PolicyConfig_Entry `protobuf:"bytes,1,rep,name=policies,proto3" json:"policies,omitempty"`
	// contains filtered or unexported fields
}

A PolicyConfig encapsulates a set of quota policies.

func (*PolicyConfig) Descriptor deprecated

func (*PolicyConfig) Descriptor() ([]byte, []int)

Deprecated: Use PolicyConfig.ProtoReflect.Descriptor instead.

func (*PolicyConfig) GetPolicies

func (x *PolicyConfig) GetPolicies() []*PolicyConfig_Entry

func (*PolicyConfig) ProtoMessage

func (*PolicyConfig) ProtoMessage()

func (*PolicyConfig) ProtoReflect

func (x *PolicyConfig) ProtoReflect() protoreflect.Message

func (*PolicyConfig) Reset

func (x *PolicyConfig) Reset()

func (*PolicyConfig) String

func (x *PolicyConfig) String() string

func (*PolicyConfig) Validate

func (m *PolicyConfig) Validate() error

Validate checks the field values on PolicyConfig with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*PolicyConfig) ValidateAll

func (m *PolicyConfig) ValidateAll() error

ValidateAll checks the field values on PolicyConfig with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in PolicyConfigMultiError, or nil if none found.

type PolicyConfigID

type PolicyConfigID struct {

	// The short application id.
	//
	// This is used to separate different applications in the same service
	// deployment.
	//
	// This should be a short indicator of what logical service this PolicyConfig
	// applies to (like `cv` or `rdb`, not `luci-cv.appspot.com`).
	AppId string `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"`
	// The LUCI realm that the PolicyConfig belongs to.
	//
	// This is a global realm string (i.e. includes the project).
	//
	// NOTE: This realm and the Account realm will USUALLY NOT match. The realm here
	// is indicating the realm in which this PolicyConfig is administered (e.g.
	// admins/services can write, read or purge it). The Account realm indicates
	// where the governed _resource_ lives, and the service can apply a Policy
	// from a Config in any realm it needs to.
	//
	// Examples:
	//
	//	chromium:@project
	//	@internal:<LUCI service-name>
	Realm string `protobuf:"bytes,2,opt,name=realm,proto3" json:"realm,omitempty"`
	// Version scheme indicates which algorithm was used to calculate `version`.
	//
	// The value `0` indicates that `version` was provided by the user.
	//
	// Currently the highest version_scheme supported is `1`.
	VersionScheme uint32 `protobuf:"varint,3,opt,name=version_scheme,json=versionScheme,proto3" json:"version_scheme,omitempty"`
	// The version of this PolicyConfig (ASI).
	Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

Identifies a PolicyConfig (group of Policies).

func (*PolicyConfigID) Descriptor deprecated

func (*PolicyConfigID) Descriptor() ([]byte, []int)

Deprecated: Use PolicyConfigID.ProtoReflect.Descriptor instead.

func (*PolicyConfigID) GetAppId

func (x *PolicyConfigID) GetAppId() string

func (*PolicyConfigID) GetRealm

func (x *PolicyConfigID) GetRealm() string

func (*PolicyConfigID) GetVersion

func (x *PolicyConfigID) GetVersion() string

func (*PolicyConfigID) GetVersionScheme

func (x *PolicyConfigID) GetVersionScheme() uint32

func (*PolicyConfigID) ProtoMessage

func (*PolicyConfigID) ProtoMessage()

func (*PolicyConfigID) ProtoReflect

func (x *PolicyConfigID) ProtoReflect() protoreflect.Message

func (*PolicyConfigID) Reset

func (x *PolicyConfigID) Reset()

func (*PolicyConfigID) String

func (x *PolicyConfigID) String() string

func (*PolicyConfigID) Validate

func (m *PolicyConfigID) Validate() error

Validate checks the field values on PolicyConfigID with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*PolicyConfigID) ValidateAll

func (m *PolicyConfigID) ValidateAll() error

ValidateAll checks the field values on PolicyConfigID with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in PolicyConfigIDMultiError, or nil if none found.

type PolicyConfigIDMultiError

type PolicyConfigIDMultiError []error

PolicyConfigIDMultiError is an error wrapping multiple validation errors returned by PolicyConfigID.ValidateAll() if the designated constraints aren't met.

func (PolicyConfigIDMultiError) AllErrors

func (m PolicyConfigIDMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (PolicyConfigIDMultiError) Error

func (m PolicyConfigIDMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type PolicyConfigIDValidationError

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

PolicyConfigIDValidationError is the validation error returned by PolicyConfigID.Validate if the designated constraints aren't met.

func (PolicyConfigIDValidationError) Cause

Cause function returns cause value.

func (PolicyConfigIDValidationError) Error

Error satisfies the builtin error interface

func (PolicyConfigIDValidationError) ErrorName

func (e PolicyConfigIDValidationError) ErrorName() string

ErrorName returns error name.

func (PolicyConfigIDValidationError) Field

Field function returns field value.

func (PolicyConfigIDValidationError) Key

Key function returns key value.

func (PolicyConfigIDValidationError) Reason

Reason function returns reason value.

type PolicyConfigMultiError

type PolicyConfigMultiError []error

PolicyConfigMultiError is an error wrapping multiple validation errors returned by PolicyConfig.ValidateAll() if the designated constraints aren't met.

func (PolicyConfigMultiError) AllErrors

func (m PolicyConfigMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (PolicyConfigMultiError) Error

func (m PolicyConfigMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type PolicyConfigValidationError

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

PolicyConfigValidationError is the validation error returned by PolicyConfig.Validate if the designated constraints aren't met.

func (PolicyConfigValidationError) Cause

Cause function returns cause value.

func (PolicyConfigValidationError) Error

Error satisfies the builtin error interface

func (PolicyConfigValidationError) ErrorName

func (e PolicyConfigValidationError) ErrorName() string

ErrorName returns error name.

func (PolicyConfigValidationError) Field

Field function returns field value.

func (PolicyConfigValidationError) Key

Key function returns key value.

func (PolicyConfigValidationError) Reason

Reason function returns reason value.

type PolicyConfig_Entry

type PolicyConfig_Entry struct {
	Key    *PolicyKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Policy *Policy    `protobuf:"bytes,2,opt,name=policy,proto3" json:"policy,omitempty"`
	// contains filtered or unexported fields
}

func (*PolicyConfig_Entry) Descriptor deprecated

func (*PolicyConfig_Entry) Descriptor() ([]byte, []int)

Deprecated: Use PolicyConfig_Entry.ProtoReflect.Descriptor instead.

func (*PolicyConfig_Entry) GetKey

func (x *PolicyConfig_Entry) GetKey() *PolicyKey

func (*PolicyConfig_Entry) GetPolicy

func (x *PolicyConfig_Entry) GetPolicy() *Policy

func (*PolicyConfig_Entry) ProtoMessage

func (*PolicyConfig_Entry) ProtoMessage()

func (*PolicyConfig_Entry) ProtoReflect

func (x *PolicyConfig_Entry) ProtoReflect() protoreflect.Message

func (*PolicyConfig_Entry) Reset

func (x *PolicyConfig_Entry) Reset()

func (*PolicyConfig_Entry) String

func (x *PolicyConfig_Entry) String() string

func (*PolicyConfig_Entry) Validate

func (m *PolicyConfig_Entry) Validate() error

Validate checks the field values on PolicyConfig_Entry with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*PolicyConfig_Entry) ValidateAll

func (m *PolicyConfig_Entry) ValidateAll() error

ValidateAll checks the field values on PolicyConfig_Entry with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in PolicyConfig_EntryMultiError, or nil if none found.

type PolicyConfig_EntryMultiError

type PolicyConfig_EntryMultiError []error

PolicyConfig_EntryMultiError is an error wrapping multiple validation errors returned by PolicyConfig_Entry.ValidateAll() if the designated constraints aren't met.

func (PolicyConfig_EntryMultiError) AllErrors

func (m PolicyConfig_EntryMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (PolicyConfig_EntryMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type PolicyConfig_EntryValidationError

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

PolicyConfig_EntryValidationError is the validation error returned by PolicyConfig_Entry.Validate if the designated constraints aren't met.

func (PolicyConfig_EntryValidationError) Cause

Cause function returns cause value.

func (PolicyConfig_EntryValidationError) Error

Error satisfies the builtin error interface

func (PolicyConfig_EntryValidationError) ErrorName

ErrorName returns error name.

func (PolicyConfig_EntryValidationError) Field

Field function returns field value.

func (PolicyConfig_EntryValidationError) Key

Key function returns key value.

func (PolicyConfig_EntryValidationError) Reason

Reason function returns reason value.

type PolicyID

type PolicyID struct {
	Config *PolicyConfigID `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	Key    *PolicyKey      `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

Looking up a single policy requires a PolicyConfigID and a PolicyKey.

The PolicyConfigID identifies which policy config contains the entry required, and the PolicyKey refers to a specific policy within that config.

Also see PolicyRef.

func (*PolicyID) Descriptor deprecated

func (*PolicyID) Descriptor() ([]byte, []int)

Deprecated: Use PolicyID.ProtoReflect.Descriptor instead.

func (*PolicyID) GetConfig

func (x *PolicyID) GetConfig() *PolicyConfigID

func (*PolicyID) GetKey

func (x *PolicyID) GetKey() *PolicyKey

func (*PolicyID) ProtoMessage

func (*PolicyID) ProtoMessage()

func (*PolicyID) ProtoReflect

func (x *PolicyID) ProtoReflect() protoreflect.Message

func (*PolicyID) Reset

func (x *PolicyID) Reset()

func (*PolicyID) String

func (x *PolicyID) String() string

func (*PolicyID) Validate

func (m *PolicyID) Validate() error

Validate checks the field values on PolicyID with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*PolicyID) ValidateAll

func (m *PolicyID) ValidateAll() error

ValidateAll checks the field values on PolicyID with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in PolicyIDMultiError, or nil if none found.

type PolicyIDMultiError

type PolicyIDMultiError []error

PolicyIDMultiError is an error wrapping multiple validation errors returned by PolicyID.ValidateAll() if the designated constraints aren't met.

func (PolicyIDMultiError) AllErrors

func (m PolicyIDMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (PolicyIDMultiError) Error

func (m PolicyIDMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type PolicyIDValidationError

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

PolicyIDValidationError is the validation error returned by PolicyID.Validate if the designated constraints aren't met.

func (PolicyIDValidationError) Cause

func (e PolicyIDValidationError) Cause() error

Cause function returns cause value.

func (PolicyIDValidationError) Error

func (e PolicyIDValidationError) Error() string

Error satisfies the builtin error interface

func (PolicyIDValidationError) ErrorName

func (e PolicyIDValidationError) ErrorName() string

ErrorName returns error name.

func (PolicyIDValidationError) Field

func (e PolicyIDValidationError) Field() string

Field function returns field value.

func (PolicyIDValidationError) Key

func (e PolicyIDValidationError) Key() bool

Key function returns key value.

func (PolicyIDValidationError) Reason

func (e PolicyIDValidationError) Reason() string

Reason function returns reason value.

type PolicyKey

type PolicyKey struct {

	// The namespace of the Policy (ASI).
	//
	// Used by the application to logically separate multiple policy groups
	// within the same realm.
	//
	// Examples:
	//
	//	cqGroupName
	//	RPCService.RPCName
	Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// The name of the Policy (ASI)
	//
	// Examples:
	//
	//	account|user:identity
	//	sharedQuota|sharedAccountName
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// The type of resource managed by this policy (ASI)
	//
	// (e.g. runs, qps, data_size, etc.)
	ResourceType string `protobuf:"bytes,3,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"`
	// contains filtered or unexported fields
}

PolicyKey identifies a single Policy inside of a PolicyConfig.

func (*PolicyKey) Descriptor deprecated

func (*PolicyKey) Descriptor() ([]byte, []int)

Deprecated: Use PolicyKey.ProtoReflect.Descriptor instead.

func (*PolicyKey) GetName

func (x *PolicyKey) GetName() string

func (*PolicyKey) GetNamespace

func (x *PolicyKey) GetNamespace() string

func (*PolicyKey) GetResourceType

func (x *PolicyKey) GetResourceType() string

func (*PolicyKey) ProtoMessage

func (*PolicyKey) ProtoMessage()

func (*PolicyKey) ProtoReflect

func (x *PolicyKey) ProtoReflect() protoreflect.Message

func (*PolicyKey) Reset

func (x *PolicyKey) Reset()

func (*PolicyKey) String

func (x *PolicyKey) String() string

func (*PolicyKey) Validate

func (m *PolicyKey) Validate() error

Validate checks the field values on PolicyKey with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*PolicyKey) ValidateAll

func (m *PolicyKey) ValidateAll() error

ValidateAll checks the field values on PolicyKey with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in PolicyKeyMultiError, or nil if none found.

type PolicyKeyMultiError

type PolicyKeyMultiError []error

PolicyKeyMultiError is an error wrapping multiple validation errors returned by PolicyKey.ValidateAll() if the designated constraints aren't met.

func (PolicyKeyMultiError) AllErrors

func (m PolicyKeyMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (PolicyKeyMultiError) Error

func (m PolicyKeyMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type PolicyKeyValidationError

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

PolicyKeyValidationError is the validation error returned by PolicyKey.Validate if the designated constraints aren't met.

func (PolicyKeyValidationError) Cause

func (e PolicyKeyValidationError) Cause() error

Cause function returns cause value.

func (PolicyKeyValidationError) Error

func (e PolicyKeyValidationError) Error() string

Error satisfies the builtin error interface

func (PolicyKeyValidationError) ErrorName

func (e PolicyKeyValidationError) ErrorName() string

ErrorName returns error name.

func (PolicyKeyValidationError) Field

func (e PolicyKeyValidationError) Field() string

Field function returns field value.

func (PolicyKeyValidationError) Key

Key function returns key value.

func (PolicyKeyValidationError) Reason

func (e PolicyKeyValidationError) Reason() string

Reason function returns reason value.

type PolicyMultiError

type PolicyMultiError []error

PolicyMultiError is an error wrapping multiple validation errors returned by Policy.ValidateAll() if the designated constraints aren't met.

func (PolicyMultiError) AllErrors

func (m PolicyMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (PolicyMultiError) Error

func (m PolicyMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type PolicyRef

type PolicyRef struct {

	// config is a PolicyConfigID where all fields have been joined with `~`, and
	// then `"a~p~` prepended.
	Config string `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	// key is a PolicyKey where all fields have been joined with `~`.
	Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

PolicyRef holds the same data as a PolicyID, but in string-encoded form.

This is used by the quota library internally, but also appears in e.g. Account (because the Account object needs to be directly manipulated by the quota library internals). All RPC and API surfaces for the quota library use PolicyID instead.

TODO(iannucci) -- add regex?

func (*PolicyRef) Descriptor deprecated

func (*PolicyRef) Descriptor() ([]byte, []int)

Deprecated: Use PolicyRef.ProtoReflect.Descriptor instead.

func (*PolicyRef) GetConfig

func (x *PolicyRef) GetConfig() string

func (*PolicyRef) GetKey

func (x *PolicyRef) GetKey() string

func (*PolicyRef) ProtoMessage

func (*PolicyRef) ProtoMessage()

func (*PolicyRef) ProtoReflect

func (x *PolicyRef) ProtoReflect() protoreflect.Message

func (*PolicyRef) Reset

func (x *PolicyRef) Reset()

func (*PolicyRef) String

func (x *PolicyRef) String() string

func (*PolicyRef) Validate

func (m *PolicyRef) Validate() error

Validate checks the field values on PolicyRef with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*PolicyRef) ValidateAll

func (m *PolicyRef) ValidateAll() error

ValidateAll checks the field values on PolicyRef with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in PolicyRefMultiError, or nil if none found.

type PolicyRefMultiError

type PolicyRefMultiError []error

PolicyRefMultiError is an error wrapping multiple validation errors returned by PolicyRef.ValidateAll() if the designated constraints aren't met.

func (PolicyRefMultiError) AllErrors

func (m PolicyRefMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (PolicyRefMultiError) Error

func (m PolicyRefMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type PolicyRefValidationError

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

PolicyRefValidationError is the validation error returned by PolicyRef.Validate if the designated constraints aren't met.

func (PolicyRefValidationError) Cause

func (e PolicyRefValidationError) Cause() error

Cause function returns cause value.

func (PolicyRefValidationError) Error

func (e PolicyRefValidationError) Error() string

Error satisfies the builtin error interface

func (PolicyRefValidationError) ErrorName

func (e PolicyRefValidationError) ErrorName() string

ErrorName returns error name.

func (PolicyRefValidationError) Field

func (e PolicyRefValidationError) Field() string

Field function returns field value.

func (PolicyRefValidationError) Key

Key function returns key value.

func (PolicyRefValidationError) Reason

func (e PolicyRefValidationError) Reason() string

Reason function returns reason value.

type PolicyValidationError

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

PolicyValidationError is the validation error returned by Policy.Validate if the designated constraints aren't met.

func (PolicyValidationError) Cause

func (e PolicyValidationError) Cause() error

Cause function returns cause value.

func (PolicyValidationError) Error

func (e PolicyValidationError) Error() string

Error satisfies the builtin error interface

func (PolicyValidationError) ErrorName

func (e PolicyValidationError) ErrorName() string

ErrorName returns error name.

func (PolicyValidationError) Field

func (e PolicyValidationError) Field() string

Field function returns field value.

func (PolicyValidationError) Key

func (e PolicyValidationError) Key() bool

Key function returns key value.

func (PolicyValidationError) Reason

func (e PolicyValidationError) Reason() string

Reason function returns reason value.

type Policy_Options

type Policy_Options int32
const (
	Policy_NO_OPTIONS Policy_Options = 0
	// Indicates that this Policy covers a resource type which represents an
	// absolute quantity (e.g. number of builds in flight, current amount of
	// storage used, etc.). Accounts flagged with this option cannot be manually
	// manipulated via the Admin API, even with `quota.accounts.write`
	// permission. Applications which need to expose 'reset' functionality for
	// these should expose their own endpoints for this (or, ideally, don't
	// allow these Accounts to get out of sync with reality in the first place
	// :))
	Policy_ABSOLUTE_RESOURCE Policy_Options = 1
)

func (Policy_Options) Descriptor

func (Policy_Options) Enum

func (x Policy_Options) Enum() *Policy_Options

func (Policy_Options) EnumDescriptor deprecated

func (Policy_Options) EnumDescriptor() ([]byte, []int)

Deprecated: Use Policy_Options.Descriptor instead.

func (Policy_Options) Number

func (Policy_Options) String

func (x Policy_Options) String() string

func (Policy_Options) Type

type Policy_Refill

type Policy_Refill struct {

	// The number of units to add to the Account banance every `interval`.
	//
	// The refill process is discrete; From T0..T0+interval, none of
	// these units will appear in the Account balance. At T0+interval, all
	// the units will be added.
	//
	// Note that it's permitted to have a negative refill `units` to have
	// Account balances drain back to 0 over time.
	//
	// It's not permitted for the units to be 0 (just omit the Refill message
	// entirely in that case).
	Units int64 `protobuf:"varint,1,opt,name=units,proto3" json:"units,omitempty"`
	// The number of seconds between refill events, synchronized to UTC midnight
	// + `offset`.
	//
	// If this is 0 and `units` is positive, the Account will be treated as if
	// it always has `limit` quota.
	//
	// It is an error for this to be 0 with negative `units`. To achieve this,
	// just make a Policy with a limit of 0 and no Refill.
	//
	// Refill events occur synchronized to "midnight" in UTC. So if you set this
	// to 60, then each minute-after-UTC-midnight, the Account will gain
	// `units`. This synchronization makes quota Account refill more
	// predictable.
	//
	// The offset from UTC is currently configed on the Policy (i.e. to support
	// policies which are synched with different time zones), but this
	// presumably could instead be configured on a per-Account basis, if it were
	// needed.
	//
	// This MUST evenly divide 24h (86400). For example, an interval of 71 is
	// NOT OK because it would divide the day into 1216.9 intervals, meaning
	// that the refresh 'cycle' could not correctly reset at midnight every day.
	// An interval of 72 IS ok though, because it evenly divides the day into
	// 1200 refresh periods.
	Interval uint32 `protobuf:"varint,2,opt,name=interval,proto3" json:"interval,omitempty"`
	// An offset from UTC midnight. This will be used to establish when the
	// associated Accounts 'start their day', and can be used to implement
	// a rudimentary timezone alignment for quota Accounts.
	Offset uint32 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"`
	// contains filtered or unexported fields
}

Refill describes how Accounts under this Policy refill (or drain) over time.

The Refill process mimics a cron, starting at UTC midnight + offset, waking up every `interval` seconds to add `units` to the Account balance (up to `limit`). This refill operation only happens when an Account is actually interacted with, however.

func (*Policy_Refill) Descriptor deprecated

func (*Policy_Refill) Descriptor() ([]byte, []int)

Deprecated: Use Policy_Refill.ProtoReflect.Descriptor instead.

func (*Policy_Refill) GetInterval

func (x *Policy_Refill) GetInterval() uint32

func (*Policy_Refill) GetOffset

func (x *Policy_Refill) GetOffset() uint32

func (*Policy_Refill) GetUnits

func (x *Policy_Refill) GetUnits() int64

func (*Policy_Refill) ProtoMessage

func (*Policy_Refill) ProtoMessage()

func (*Policy_Refill) ProtoReflect

func (x *Policy_Refill) ProtoReflect() protoreflect.Message

func (*Policy_Refill) Reset

func (x *Policy_Refill) Reset()

func (*Policy_Refill) String

func (x *Policy_Refill) String() string

func (*Policy_Refill) Validate

func (m *Policy_Refill) Validate() error

Validate checks the field values on Policy_Refill with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Policy_Refill) ValidateAll

func (m *Policy_Refill) ValidateAll() error

ValidateAll checks the field values on Policy_Refill with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in Policy_RefillMultiError, or nil if none found.

type Policy_RefillMultiError

type Policy_RefillMultiError []error

Policy_RefillMultiError is an error wrapping multiple validation errors returned by Policy_Refill.ValidateAll() if the designated constraints aren't met.

func (Policy_RefillMultiError) AllErrors

func (m Policy_RefillMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (Policy_RefillMultiError) Error

func (m Policy_RefillMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type Policy_RefillValidationError

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

Policy_RefillValidationError is the validation error returned by Policy_Refill.Validate if the designated constraints aren't met.

func (Policy_RefillValidationError) Cause

Cause function returns cause value.

func (Policy_RefillValidationError) Error

Error satisfies the builtin error interface

func (Policy_RefillValidationError) ErrorName

func (e Policy_RefillValidationError) ErrorName() string

ErrorName returns error name.

func (Policy_RefillValidationError) Field

Field function returns field value.

func (Policy_RefillValidationError) Key

Key function returns key value.

func (Policy_RefillValidationError) Reason

Reason function returns reason value.

type RawOp

type RawOp struct {
	AccountRef string `protobuf:"bytes,1,opt,name=account_ref,json=accountRef,proto3" json:"account_ref,omitempty"`
	// policy_id of {"", ""} means "remove policy"
	PolicyRef  *PolicyRef    `protobuf:"bytes,2,opt,name=policy_ref,json=policyRef,proto3" json:"policy_ref,omitempty"`
	RelativeTo Op_RelativeTo `` /* 153-byte string literal not displayed */
	Delta      int64         `protobuf:"varint,4,opt,name=delta,proto3" json:"delta,omitempty"`
	Options    uint32        `protobuf:"varint,5,opt,name=options,proto3" json:"options,omitempty"`
	// contains filtered or unexported fields
}

func (*RawOp) Descriptor deprecated

func (*RawOp) Descriptor() ([]byte, []int)

Deprecated: Use RawOp.ProtoReflect.Descriptor instead.

func (*RawOp) GetAccountRef

func (x *RawOp) GetAccountRef() string

func (*RawOp) GetDelta

func (x *RawOp) GetDelta() int64

func (*RawOp) GetOptions

func (x *RawOp) GetOptions() uint32

func (*RawOp) GetPolicyRef

func (x *RawOp) GetPolicyRef() *PolicyRef

func (*RawOp) GetRelativeTo

func (x *RawOp) GetRelativeTo() Op_RelativeTo

func (*RawOp) ProtoMessage

func (*RawOp) ProtoMessage()

func (*RawOp) ProtoReflect

func (x *RawOp) ProtoReflect() protoreflect.Message

func (*RawOp) Reset

func (x *RawOp) Reset()

func (*RawOp) String

func (x *RawOp) String() string

func (*RawOp) Validate

func (m *RawOp) Validate() error

Validate checks the field values on RawOp with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*RawOp) ValidateAll

func (m *RawOp) ValidateAll() error

ValidateAll checks the field values on RawOp with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in RawOpMultiError, or nil if none found.

type RawOpMultiError

type RawOpMultiError []error

RawOpMultiError is an error wrapping multiple validation errors returned by RawOp.ValidateAll() if the designated constraints aren't met.

func (RawOpMultiError) AllErrors

func (m RawOpMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (RawOpMultiError) Error

func (m RawOpMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type RawOpValidationError

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

RawOpValidationError is the validation error returned by RawOp.Validate if the designated constraints aren't met.

func (RawOpValidationError) Cause

func (e RawOpValidationError) Cause() error

Cause function returns cause value.

func (RawOpValidationError) Error

func (e RawOpValidationError) Error() string

Error satisfies the builtin error interface

func (RawOpValidationError) ErrorName

func (e RawOpValidationError) ErrorName() string

ErrorName returns error name.

func (RawOpValidationError) Field

func (e RawOpValidationError) Field() string

Field function returns field value.

func (RawOpValidationError) Key

func (e RawOpValidationError) Key() bool

Key function returns key value.

func (RawOpValidationError) Reason

func (e RawOpValidationError) Reason() string

Reason function returns reason value.

type RequestDedupKey

type RequestDedupKey struct {

	// The luci auth Identity which issued this request.
	Ident string `protobuf:"bytes,1,opt,name=ident,proto3" json:"ident,omitempty"`
	// The user-supplied request id.
	RequestId string `protobuf:"bytes,2,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// contains filtered or unexported fields
}

An RequestDedupEntry represents the data used for a unique request deduplication entry key.

func (*RequestDedupKey) Descriptor deprecated

func (*RequestDedupKey) Descriptor() ([]byte, []int)

Deprecated: Use RequestDedupKey.ProtoReflect.Descriptor instead.

func (*RequestDedupKey) GetIdent

func (x *RequestDedupKey) GetIdent() string

func (*RequestDedupKey) GetRequestId

func (x *RequestDedupKey) GetRequestId() string

func (*RequestDedupKey) ProtoMessage

func (*RequestDedupKey) ProtoMessage()

func (*RequestDedupKey) ProtoReflect

func (x *RequestDedupKey) ProtoReflect() protoreflect.Message

func (*RequestDedupKey) Reset

func (x *RequestDedupKey) Reset()

func (*RequestDedupKey) String

func (x *RequestDedupKey) String() string

func (*RequestDedupKey) Validate

func (m *RequestDedupKey) Validate() error

Validate checks the field values on RequestDedupKey with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*RequestDedupKey) ValidateAll

func (m *RequestDedupKey) ValidateAll() error

ValidateAll checks the field values on RequestDedupKey with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in RequestDedupKeyMultiError, or nil if none found.

type RequestDedupKeyMultiError

type RequestDedupKeyMultiError []error

RequestDedupKeyMultiError is an error wrapping multiple validation errors returned by RequestDedupKey.ValidateAll() if the designated constraints aren't met.

func (RequestDedupKeyMultiError) AllErrors

func (m RequestDedupKeyMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (RequestDedupKeyMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type RequestDedupKeyValidationError

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

RequestDedupKeyValidationError is the validation error returned by RequestDedupKey.Validate if the designated constraints aren't met.

func (RequestDedupKeyValidationError) Cause

Cause function returns cause value.

func (RequestDedupKeyValidationError) Error

Error satisfies the builtin error interface

func (RequestDedupKeyValidationError) ErrorName

func (e RequestDedupKeyValidationError) ErrorName() string

ErrorName returns error name.

func (RequestDedupKeyValidationError) Field

Field function returns field value.

func (RequestDedupKeyValidationError) Key

Key function returns key value.

func (RequestDedupKeyValidationError) Reason

Reason function returns reason value.

type UnimplementedAdminServer

type UnimplementedAdminServer struct {
}

UnimplementedAdminServer can be embedded to have forward compatible implementations.

func (*UnimplementedAdminServer) ApplyOps

func (*UnimplementedAdminServer) GetAccounts

func (*UnimplementedAdminServer) WritePolicyConfig

type UpdateAccountsInput

type UpdateAccountsInput struct {

	// request_key is a serialized RequestDedupKey.
	RequestKey string `protobuf:"bytes,1,opt,name=request_key,json=requestKey,proto3" json:"request_key,omitempty"`
	// Required if request_key is set.
	RequestKeyTtl *durationpb.Duration `protobuf:"bytes,2,opt,name=request_key_ttl,json=requestKeyTtl,proto3" json:"request_key_ttl,omitempty"`
	// Version scheme indicates which algorithm was used to calculate `version`.
	//
	// The value `0` indicates that `version` was provided by the user.
	//
	// Currently the ONLY ops_hash_scheme supported is `1`.
	//
	// If, in the future, more hash schemes are added, because request
	// deduplication entries are transient, we do the following:
	// If a request comes in, and req.ops_hash_scheme != self.ops_hash_scheme,
	// return the cached response as if ops_hash matches.
	//
	// Note that the upshot of this is that requests with the same request_id, but
	// differing contents, will be incorrectly served with an OK response when
	// upgrading the hash_scheme.
	HashScheme uint32 `protobuf:"varint,3,opt,name=hash_scheme,json=hashScheme,proto3" json:"hash_scheme,omitempty"`
	// A hash calculated by the Go library of the following fields in
	// a deterministic way, according to req_hash_scheme:
	//   - ops
	//
	// This is saved for the deduplication entry and expected to match.
	Hash string   `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"`
	Ops  []*RawOp `protobuf:"bytes,5,rep,name=ops,proto3" json:"ops,omitempty"`
	// contains filtered or unexported fields
}

UpdateAccountsInput is the message that the Go library will use to invoke update-accounts.lua.

See ApplyOpsRequest for `request_id` and `request_id_ttl` fields.

Validation rules are omitted from this because lua doesn't use them, and Go will never read this message.

func (*UpdateAccountsInput) Descriptor deprecated

func (*UpdateAccountsInput) Descriptor() ([]byte, []int)

Deprecated: Use UpdateAccountsInput.ProtoReflect.Descriptor instead.

func (*UpdateAccountsInput) GetHash

func (x *UpdateAccountsInput) GetHash() string

func (*UpdateAccountsInput) GetHashScheme

func (x *UpdateAccountsInput) GetHashScheme() uint32

func (*UpdateAccountsInput) GetOps

func (x *UpdateAccountsInput) GetOps() []*RawOp

func (*UpdateAccountsInput) GetRequestKey

func (x *UpdateAccountsInput) GetRequestKey() string

func (*UpdateAccountsInput) GetRequestKeyTtl

func (x *UpdateAccountsInput) GetRequestKeyTtl() *durationpb.Duration

func (*UpdateAccountsInput) ProtoMessage

func (*UpdateAccountsInput) ProtoMessage()

func (*UpdateAccountsInput) ProtoReflect

func (x *UpdateAccountsInput) ProtoReflect() protoreflect.Message

func (*UpdateAccountsInput) Reset

func (x *UpdateAccountsInput) Reset()

func (*UpdateAccountsInput) String

func (x *UpdateAccountsInput) String() string

func (*UpdateAccountsInput) Validate

func (m *UpdateAccountsInput) Validate() error

Validate checks the field values on UpdateAccountsInput with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*UpdateAccountsInput) ValidateAll

func (m *UpdateAccountsInput) ValidateAll() error

ValidateAll checks the field values on UpdateAccountsInput with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UpdateAccountsInputMultiError, or nil if none found.

type UpdateAccountsInputMultiError

type UpdateAccountsInputMultiError []error

UpdateAccountsInputMultiError is an error wrapping multiple validation errors returned by UpdateAccountsInput.ValidateAll() if the designated constraints aren't met.

func (UpdateAccountsInputMultiError) AllErrors

func (m UpdateAccountsInputMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UpdateAccountsInputMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type UpdateAccountsInputValidationError

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

UpdateAccountsInputValidationError is the validation error returned by UpdateAccountsInput.Validate if the designated constraints aren't met.

func (UpdateAccountsInputValidationError) Cause

Cause function returns cause value.

func (UpdateAccountsInputValidationError) Error

Error satisfies the builtin error interface

func (UpdateAccountsInputValidationError) ErrorName

ErrorName returns error name.

func (UpdateAccountsInputValidationError) Field

Field function returns field value.

func (UpdateAccountsInputValidationError) Key

Key function returns key value.

func (UpdateAccountsInputValidationError) Reason

Reason function returns reason value.

type WritePolicyConfigRequest

type WritePolicyConfigRequest struct {

	// If id.version_kind != Manual, id.version will be ignored.
	Id           *PolicyConfigID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	PolicyConfig *PolicyConfig   `protobuf:"bytes,2,opt,name=policy_config,json=policyConfig,proto3" json:"policy_config,omitempty"`
	// contains filtered or unexported fields
}

func (*WritePolicyConfigRequest) Descriptor deprecated

func (*WritePolicyConfigRequest) Descriptor() ([]byte, []int)

Deprecated: Use WritePolicyConfigRequest.ProtoReflect.Descriptor instead.

func (*WritePolicyConfigRequest) GetId

func (*WritePolicyConfigRequest) GetPolicyConfig

func (x *WritePolicyConfigRequest) GetPolicyConfig() *PolicyConfig

func (*WritePolicyConfigRequest) ProtoMessage

func (*WritePolicyConfigRequest) ProtoMessage()

func (*WritePolicyConfigRequest) ProtoReflect

func (x *WritePolicyConfigRequest) ProtoReflect() protoreflect.Message

func (*WritePolicyConfigRequest) Reset

func (x *WritePolicyConfigRequest) Reset()

func (*WritePolicyConfigRequest) String

func (x *WritePolicyConfigRequest) String() string

func (*WritePolicyConfigRequest) Validate

func (m *WritePolicyConfigRequest) Validate() error

Validate checks the field values on WritePolicyConfigRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*WritePolicyConfigRequest) ValidateAll

func (m *WritePolicyConfigRequest) ValidateAll() error

ValidateAll checks the field values on WritePolicyConfigRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in WritePolicyConfigRequestMultiError, or nil if none found.

type WritePolicyConfigRequestMultiError

type WritePolicyConfigRequestMultiError []error

WritePolicyConfigRequestMultiError is an error wrapping multiple validation errors returned by WritePolicyConfigRequest.ValidateAll() if the designated constraints aren't met.

func (WritePolicyConfigRequestMultiError) AllErrors

func (m WritePolicyConfigRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (WritePolicyConfigRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type WritePolicyConfigRequestValidationError

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

WritePolicyConfigRequestValidationError is the validation error returned by WritePolicyConfigRequest.Validate if the designated constraints aren't met.

func (WritePolicyConfigRequestValidationError) Cause

Cause function returns cause value.

func (WritePolicyConfigRequestValidationError) Error

Error satisfies the builtin error interface

func (WritePolicyConfigRequestValidationError) ErrorName

ErrorName returns error name.

func (WritePolicyConfigRequestValidationError) Field

Field function returns field value.

func (WritePolicyConfigRequestValidationError) Key

Key function returns key value.

func (WritePolicyConfigRequestValidationError) Reason

Reason function returns reason value.

type WritePolicyConfigResponse

type WritePolicyConfigResponse struct {

	// Returns the computed hash version (or responds with the input `version` if
	// using an application-specific version)
	Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

func (*WritePolicyConfigResponse) Descriptor deprecated

func (*WritePolicyConfigResponse) Descriptor() ([]byte, []int)

Deprecated: Use WritePolicyConfigResponse.ProtoReflect.Descriptor instead.

func (*WritePolicyConfigResponse) GetVersion

func (x *WritePolicyConfigResponse) GetVersion() string

func (*WritePolicyConfigResponse) ProtoMessage

func (*WritePolicyConfigResponse) ProtoMessage()

func (*WritePolicyConfigResponse) ProtoReflect

func (*WritePolicyConfigResponse) Reset

func (x *WritePolicyConfigResponse) Reset()

func (*WritePolicyConfigResponse) String

func (x *WritePolicyConfigResponse) String() string

func (*WritePolicyConfigResponse) Validate

func (m *WritePolicyConfigResponse) Validate() error

Validate checks the field values on WritePolicyConfigResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*WritePolicyConfigResponse) ValidateAll

func (m *WritePolicyConfigResponse) ValidateAll() error

ValidateAll checks the field values on WritePolicyConfigResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in WritePolicyConfigResponseMultiError, or nil if none found.

type WritePolicyConfigResponseMultiError

type WritePolicyConfigResponseMultiError []error

WritePolicyConfigResponseMultiError is an error wrapping multiple validation errors returned by WritePolicyConfigResponse.ValidateAll() if the designated constraints aren't met.

func (WritePolicyConfigResponseMultiError) AllErrors

AllErrors returns a list of validation violation errors.

func (WritePolicyConfigResponseMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type WritePolicyConfigResponseValidationError

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

WritePolicyConfigResponseValidationError is the validation error returned by WritePolicyConfigResponse.Validate if the designated constraints aren't met.

func (WritePolicyConfigResponseValidationError) Cause

Cause function returns cause value.

func (WritePolicyConfigResponseValidationError) Error

Error satisfies the builtin error interface

func (WritePolicyConfigResponseValidationError) ErrorName

ErrorName returns error name.

func (WritePolicyConfigResponseValidationError) Field

Field function returns field value.

func (WritePolicyConfigResponseValidationError) Key

Key function returns key value.

func (WritePolicyConfigResponseValidationError) Reason

Reason function returns reason value.

Jump to

Keyboard shortcuts

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