Documentation ¶
Overview ¶
Package quotaconfig exports the interface required by the quota library to read *pb.Policy configs. Provides an in-memory implementation of the interface suitable for testing. See quotaconfig subpackages for other implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("policy not found")
ErrNotFound must be returned by Interface.Get implementations when the named *pb.Policy is not found.
Functions ¶
func ValidatePolicy ¶
func ValidatePolicy(ctx *validation.Context, p *pb.Policy)
ValidatePolicy validates the given *pb.Policy.
Types ¶
type Interface ¶
type Interface interface { // Get returns the named *pb.Policy or ErrNotFound if it doesn't exist. // // Called by the quota library every time quota is manipulated, // so implementations should return relatively quickly. Get(context.Context, string) (*pb.Policy, error) // Refresh fetches all *pb.Policies. // // Implementations should validate (see ValidatePolicy) and cache configs so // future Get calls return relatively quickly. Refresh(context.Context) error }
Interface encapsulates the functionality needed to implement a configuration layer usable by the quota library. Implementations should ensure returned *pb.Policies are valid (see ValidatePolicy).
Directories ¶
Path | Synopsis |
---|---|
Package configservice provides an implementation of quotaconfig.Interface which fetches *pb.Policy configs stored with the LUCI Config service.
|
Package configservice provides an implementation of quotaconfig.Interface which fetches *pb.Policy configs stored with the LUCI Config service. |
Click to show internal directories.
Click to hide internal directories.