service

package
v0.0.0-...-15beef2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: BSD-3-Clause Imports: 2 Imported by: 7

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

Constants

This section is empty.

Variables

View Source
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 (*MockServiceBrokerCatalogCacheService) Save

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)

func (*MockServiceBrokerService) Update

func (m *MockServiceBrokerService) Update(name string, broker Broker) error

type ServiceBrokerCatalogCacheService

type ServiceBrokerCatalogCacheService interface {
	Save(context.Context, string, BrokerCatalog) error
	Load(context.Context, string) (*BrokerCatalog, error)
}

type ServiceBrokerService

type ServiceBrokerService interface {
	Create(Broker) error
	Update(string, Broker) error
	Delete(string) error
	Find(string) (Broker, error)
	List() ([]Broker, error)
}

type ServiceBrokerStorage

type ServiceBrokerStorage interface {
	Insert(Broker) error
	Update(string, Broker) error
	Delete(string) error
	FindAll() ([]Broker, error)
	Find(string) (Broker, error)
}

Jump to

Keyboard shortcuts

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