Documentation ¶
Overview ¶
Package registry provides a persistence layer to manage open service broker service instances and bindings.
Package registry is the persistence layer of the service broker.
Index ¶
- Variables
- func Name(t Type, name string) string
- type Directory
- type DirectoryEntry
- type Entry
- func (e *Entry) Clone() *Entry
- func (e *Entry) Commit() error
- func (e *Entry) Delete() error
- func (e *Entry) Exists() bool
- func (e *Entry) Get(key Key, value interface{}) (bool, error)
- func (e *Entry) GetOwnerReference() metav1.OwnerReference
- func (e *Entry) GetString(key Key) (string, bool, error)
- func (e *Entry) GetUser(key string) (interface{}, bool, error)
- func (e *Entry) Inherit(o *Entry)
- func (e *Entry) Set(key Key, value interface{}) error
- func (e *Entry) SetUser(key string, value interface{}) error
- func (e *Entry) Unset(key Key)
- type Key
- type Type
Constants ¶
This section is empty.
Variables ¶
var ErrPermsission = goerrors.New("permission error")
ErrPermsission is raised when you don't have permission to read/write a registry key.
Functions ¶
Types ¶
type Directory ¶
type Directory struct {
// contains filtered or unexported fields
}
Directory is a lookup table used to locate the registry entries for a service instance. The registry must live in the same namespace as the resources it is creating in order for garbage collection to work correctly. We can only determine this when a context is provided by the API telling us the namespace a service instance is provisioned in to. To further compound the issue, the context is only provided on creation, so we need to cache where the registry exists, in a fixed location we can always access.
func NewDirectory ¶
NewDirectory lookups up or creates the registry directory.
func (*Directory) Add ¶
func (d *Directory) Add(instanceID string, dirent *DirectoryEntry) error
Add registers a directory entry for a service instance. This should only ever be set for a service instance creation.
type DirectoryEntry ¶
type DirectoryEntry struct { // Namespace is the namespace in which the service instance, // and registry entries, reside. Namespace string `json:"namespace"` }
DirectoryEntry contains persistent data about a service instance.
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
Entry is a KV store associated with each instance or binding.
func (*Entry) Clone ¶
Clone duplicates a registry entry, the clone is read only to allow concurrency while the master copy retains its read/write status.
func (*Entry) Exists ¶
Exists indicates whether the entry existed in Kubernetes when it was created.
func (*Entry) GetOwnerReference ¶
func (e *Entry) GetOwnerReference() metav1.OwnerReference
GetOwnerReference returns the owner reference to attach to all resources created referenced by the template binding.
func (*Entry) Inherit ¶
Inherit is used when creating a service binding registry entry. It gets a copy of all data cached in the service instance.
type Key ¶
type Key string
Key is an indentifier of a value in the registry entry's KV map.
const ( // Namespace is the namespace assigned to the instance. Namespace Key = "namespace" // InstanceID is the name of the service. InstanceID Key = "instance-id" // BindingID is the name of the binding. BindingID Key = "binding-id" // ServiceID is the service ID related to the instance or binding. ServiceID Key = "service-id" // PlanID is the plan ID related to the instance or binding. PlanID Key = "plan-id" // Context is the context used to create or update the instance or binding. Context Key = "context" // Parameters are the parameters used to create or update the instance or binding. Parameters Key = "parameters" // Operation records there is an asynchronous operation in progress for the instance or binding. // This is the analogue to an operation.Type. Operation Key = "operation" // OperationID is the unique ID for an asynchronous operation on an instance or binding. OperationID Key = "operation-id" // OperationStatus is the error string returned by an aysynchronous operation. OperationStatus Key = "operation-status" // DashboardURL is the dashboard URL associated with a service instance. DashboardURL Key = "dashboard-url" // Credentials is the set of credentials that may be generated for a service binding. Credentials Key = "credentials" )