Documentation ¶
Overview ¶
Copyright 2018 tsuru authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Index ¶
- Variables
- type AuthConfig
- type BasicAuthConfig
- type BearerConfig
- type Broker
- type BrokerCatalog
- type BrokerConfig
- type BrokerPlan
- type BrokerService
- type MockServiceBrokerCatalogCacheService
- type MockServiceBrokerService
- func (m *MockServiceBrokerService) Create(broker Broker) error
- func (m *MockServiceBrokerService) Delete(name string) error
- func (m *MockServiceBrokerService) Find(name string) (Broker, error)
- func (m *MockServiceBrokerService) List() ([]Broker, error)
- func (m *MockServiceBrokerService) Update(name string, broker Broker) error
- type ServiceBrokerCatalogCacheService
- type ServiceBrokerService
- type ServiceBrokerStorage
Constants ¶
This section is empty.
Variables ¶
var ( ErrServiceBrokerAlreadyExists = errors.New("service broker already exists with the same name") ErrServiceBrokerNotFound = errors.New("service broker not found") )
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
type AuthConfig struct { BasicAuthConfig *BasicAuthConfig BearerConfig *BearerConfig }
AuthConfig is a union-type representing the possible auth configurations a client may use to authenticate to a broker. Currently, only basic auth is supported.
type BasicAuthConfig ¶
type BasicAuthConfig struct { // Username is the basic auth username. Username string // Password is the basic auth password. Password string }
BasicAuthConfig represents a set of basic auth credentials.
type BearerConfig ¶
type BearerConfig struct { // Token is the bearer token. Token string }
BearerConfig represents bearer token credentials.
type Broker ¶
type Broker struct { // Name is the name of the Service Broker. Name string // URL is the URL of the Service Broker API endpoint. URL string // Config is the configuration used to setup a client for the broker Config BrokerConfig }
Broker contains the data required to request services to a Service Broker API.
type BrokerCatalog ¶
type BrokerCatalog struct {
Services []BrokerService
}
BrokerCatalog contains the data required to request services to a Service Broker API. Most of the fields are copied from osb client definition.
type BrokerConfig ¶
type BrokerConfig struct { // AuthConfig is the auth configuration the client should use to authenticate // to the broker. AuthConfig *AuthConfig // Insecure represents whether the 'InsecureSkipVerify' TLS configuration // field should be set. If the TLSConfig field is set and this field is // set to true, it overrides the value in the TLSConfig field. Insecure bool // Context is a set of key/value pairs that are going to be added to every // request to the Service Broker Context map[string]interface{} // CacheExpirationSeconds is a time duration in seconds that the Service // Broker catalog is kept in cache CacheExpirationSeconds int }
BrokerConfig exposes configuration used to talk to the broker API. Most of the fields are copied from osb client definition.
type BrokerPlan ¶
type BrokerPlan struct { // ID is a globally unique ID that identifies the plan. ID string // Name is the plan's display name. Name string // Description is a brief description of the plan, suitable for // printing by a CLI. Description string Schemas interface{} }
BrokerPlan is a plan (or tier) within a service offering.
type BrokerService ¶
type BrokerService struct { // ID is a globally unique ID that identifies the service. ID string // Name is the service's display name. Name string // Description is a brief description of the service, suitable for // printing by a CLI. Description string // Plans is the list of the Plans for a service. Plans represent // different tiers. Plans []BrokerPlan }
BrokerService is an available service listed in a broker's catalog.
type MockServiceBrokerCatalogCacheService ¶
type MockServiceBrokerCatalogCacheService struct { OnSave func(string, BrokerCatalog) error OnLoad func(string) (*BrokerCatalog, error) }
MockServiceBrokerCatalogCacheService implements ServiceBrokerCatalogCacheService interface
func (*MockServiceBrokerCatalogCacheService) Load ¶
func (m *MockServiceBrokerCatalogCacheService) Load(brokerName string) (*BrokerCatalog, error)
func (*MockServiceBrokerCatalogCacheService) Save ¶
func (m *MockServiceBrokerCatalogCacheService) Save(brokerName string, catalog BrokerCatalog) error
type MockServiceBrokerService ¶
type MockServiceBrokerService struct { OnCreate func(Broker) error OnUpdate func(string, Broker) error OnDelete func(string) error OnFind func(string) (Broker, error) OnList func() ([]Broker, error) }
MockServiceBrokerService implements ServiceBrokerService interface
func (*MockServiceBrokerService) Create ¶
func (m *MockServiceBrokerService) Create(broker Broker) error
func (*MockServiceBrokerService) Delete ¶
func (m *MockServiceBrokerService) Delete(name string) error
func (*MockServiceBrokerService) Find ¶
func (m *MockServiceBrokerService) Find(name string) (Broker, error)
func (*MockServiceBrokerService) List ¶
func (m *MockServiceBrokerService) List() ([]Broker, error)
type ServiceBrokerCatalogCacheService ¶
type ServiceBrokerCatalogCacheService interface { Save(string, BrokerCatalog) error Load(string) (*BrokerCatalog, error) }