bindings

package
v0.1.8-1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteBinding

func DeleteBinding(binding Binding, store stores.Store) error

DeleteBinding deletes the given binding from the store

func ExistsWithAuthID

func ExistsWithAuthID(authID string, serviceUUID string, host string, authType string, store stores.Store) error

ExistsWithAuthID checks if a binding with the provided auth identifier already exists under the given service type and host

func ExistsWithName

func ExistsWithName(name string, store stores.Store) error

ExistsWithName checks if a binding with the provided name already exists

Types

type Binding

type Binding struct {
	Name           string `json:"name" required:"true"`
	ServiceUUID    string `json:"service_uuid" required:"true"`
	Host           string `json:"host" required:"true"`
	UUID           string `json:"uuid"`
	AuthIdentifier string `json:"auth_identifier" required:"true"`
	UniqueKey      string `json:"unique_key" required:"true"`
	AuthType       string `json:"auth_type" required:"true"`
	CreatedOn      string `json:"created_on,omitempty"`
	LastAuth       string `json:"last_auth,omitempty"`
}

func CreateBinding

func CreateBinding(binding Binding, store stores.Store) (Binding, error)

CreateBinding creates a new binding after validating its context

func FindBindingByAuthID

func FindBindingByAuthID(authID string, serviceUUID string, host string, authType string, store stores.Store) (Binding, error)

FindBindingByAuthID queries the datastore and returns a binding based on the given auth identifier, service and host

func FindBindingByUUIDAndName

func FindBindingByUUIDAndName(uuid, name string, store stores.Store) (Binding, error)

FindBindingByUUIDAndName returns the binding associated with the provided uuid and/or name

func UpdateBinding

func UpdateBinding(original Binding, tempBind TempUpdateBinding, store stores.Store) (Binding, error)

UpdateBinding updates a binding after validating its fields

func (*Binding) Validate

func (binding *Binding) Validate(store stores.Store) error

Validate performs various checks on the fields of a binding

type BindingList

type BindingList struct {
	Bindings []Binding `json:"bindings"`
}

func FindAllBindings

func FindAllBindings(store stores.Store) (BindingList, error)

FindAllBindings returns all the bindings in the service

func FindBindingsByServiceTypeAndHost

func FindBindingsByServiceTypeAndHost(serviceUUID string, host string, store stores.Store) (BindingList, error)

FindBindingsByServiceTypeAndHost returns all the bindings of a specific service type and host

type TempUpdateBinding

type TempUpdateBinding struct {
	Name           string `json:"name"`
	ServiceUUID    string `json:"service_uuid"`
	Host           string `json:"host"`
	AuthIdentifier string `json:"auth_identifier"`
	AuthType       string `json:"auth_type"`
	UniqueKey      string `json:"unique_key"`
}

TempUpdateBinding is a struct to be used as an intermediate node when updating a binding containing only the `allowed to be updated fields`

Jump to

Keyboard shortcuts

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