# Packages
Package demo includes fake resource types for working on Consul's generic state storage without having to refer to specific features.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
AddFinalizer adds a finalizer to the given resource.
AuthorizerContext builds an ACL AuthorizerContext for the given tenancy.
AuthorizeReadWithResource is a small wrapper to ensure that the authorization function is invoked with the full resource being read instead of just an id.
Decode will generically decode the provided resource into a 2-field structure that holds onto the original Resource and the decoded contents.
DecodeAndAuthorizeRead will generate an ACLAuthorizeReadHook that decodes the specified type and passes it off to another authorization hook.
DecodeAndAuthorizeWrite will generate an ACLAuthorizeWriteHook that decodes the specified type and passes it off to another authorization hook.
DecodeAndMutate will generate a MutationHook that decodes the specified type and passes it off to another mutation hook.
DecodeAndValidate will generate a validation hook function that decodes the specified type and passes it off to another validation hook.
DecodeList will generically decode the provided resource list into a list of 2-field structures that holds onto the original Resource and the decoded contents.
DefaultClusteredTenancy returns the default tenancy for a cluster scoped resource.
DefaultIDTenancy will default/normalize the Tenancy of the provided ID in the context of some parent resource containing that ID.
DefaultNamespedTenancy returns the default tenancy for a namespace scoped resource.
DefaultPartitionedTenancy returns the default tenancy for a partition scoped resource.
DefaultReferenceTenancy will default/normalize the Tenancy of the provided Reference in the context of some parent resource containing that Reference.
EqualCondition compares two conditions for equality without reflection.
EqualID compares two resource IDs for equality without reflection.
EqualReference compares two references for equality without reflection.
EqualStatus compares two statuses for equality without reflection.
EqualStatusMap compares two status maps for equality without reflection.
EqualTenancy compares two resource tenancies for equality without reflection.
EqualType compares two resource types for equality without reflection.
GetDecodedResource will generically read the requested resource using the client and either return nil on a NotFound or decode the response value.
GetFinalizers returns the set of finalizers for the given resource.
No description provided by the author
HasFinalizer returns true if a resource has a given finalizers, false otherwise.
HasFinalizers returns true if a resource has one or more finalizers, false otherwise.
IDFromReference returns a Reference converted into an ID.
IDToString returns a string representation of pbresource.ID.
IsMarkedForDeletion returns true if a resource has been marked for deletion, false otherwise.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NoOpACLListHook is a common function that can be used if no special list permission is required for a resource.
No description provided by the author
Reference returns a reference to the resource with the given ID.
No description provided by the author
ReferenceOrIDMatch compares two references or IDs to see if they both refer to the same thing.
ReferenceToString returns a string representation of pbresource.Reference.
RemoveFinalizer removes a finalizer from the given resource.
No description provided by the author
TenancyToString returns a string representation of pbresource.Tenancy.
No description provided by the author
TypeToString returns a string representation of pbresource.Type.
ValidateName returns an error a name is not a valid resource name.
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
DeletionTimestampKey is the key in a resource's metadata that stores the timestamp when a resource was marked for deletion.
FinalizerKey is the key in resource's metadata that stores the whitespace separated list of finalizers.
MaxNameLength is the maximum length of a resource name.
ScopeCluster describes a resource that is scoped to a cluster.
ScopeNamespace applies to a resource that is scoped to a partition and namespace.
ScopePartition describes a resource that is scoped to a partition.
There is no default scope, it must be set explicitly.
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
ConstError is more or less equivalent to the stdlib errors.errorstring.
DecodedResource is a generic holder to contain an original Resource and its decoded contents.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ReferenceKey is the pointer-free representation of a ReferenceOrID suitable for a go map key.
No description provided by the author
Resource type registry.
# Interfaces
ReferenceOrID is the common accessors shared by pbresource.Reference and pbresource.ID.
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author
DecodedAuthorizationHook is the function signature needed for usage with the DecodeAndAuthorizeWrite and DecodeAndAuthorizeRead functions.
DecodedMutationHook is the function signature needed for usage with the DecodeAndMutate function The boolean return value indicates whether the Data field within the DecodedResource was modified.
DecodedValidationHook is the function signature needed for usage with the DecodeAndValidate function.
MutationHook is the function signature for a validation hook.
No description provided by the author
Scope describes the tenancy scope of a resource.
ValidationHook is the function signature for a validation hook.