config

package
v0.0.0-...-ca399ba Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2018 License: Apache-2.0 Imports: 14 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrokerAPI

type BrokerAPI struct {
	ExternalURL    string            `json:"external_url"`
	Listen         string            `json:"listen"`
	Credentials    BrokerCredentials `json:"credentials"`
	RequireTLS     bool              `json:"require_tls"`
	ServerCertFile string            `json:"server_cert_file"`
	ServerKeyFile  string            `json:"server_key_file"`
}

BrokerAPI provides the type for definition of broker API

type BrokerCredentials

type BrokerCredentials struct {
	Username string
	Password string
}

BrokerCredentials represents the credentials used by the cloud controller to connect to the broker

type CloudController

type CloudController struct {
	API               string `json:"api"`
	SkipTLSValidation bool   `json:"skip_tls_validation"`
}

CloudController is the cloud controller definition

type Config

type Config struct {
	APIVersion     string              `json:"api_version"`
	BrokerAPI      BrokerAPI           `json:"broker_api"`
	ManagementAPI  *ManagementAPI      `json:"management_api,omitempty"`
	Instances      map[string]Instance `json:"instances"`
	RoutesRegister *RoutesRegister     `json:"routes_register"`
}

Config is the configuration definition

type Dial

type Dial struct {
	Configuration *json.RawMessage `json:"configuration,omitempty"`
	Plan          brokermodel.Plan `json:"plan"`
}

Dial is the dial definition. Dials should have a configuration and a serviceplan

type Instance

type Instance struct {
	TargetURL         string                     `json:"target"`
	Name              string                     `json:"name"`
	Dials             map[string]Dial            `json:"dials"`
	Service           brokermodel.CatalogService `json:"service"`
	AuthenticationKey string                     `json:"authentication_key"`
	CaCert            string                     `json:"ca_cert,omitempty"`
	SkipSsl           bool                       `json:"skip_ssl"`
}

Instance is definition of an Instance with the corresponding info

type ManagementAPI

type ManagementAPI struct {
	Listen          string           `json:"listen"`
	DevMode         bool             `json:"dev_mode"`
	UaaClient       string           `json:"uaa_client"`
	UaaSecret       string           `json:"uaa_secret"`
	BrokerName      string           `json:"broker_name"`
	Authentication  *json.RawMessage `json:"authentication"`
	CloudController CloudController  `json:"cloud_controller"`
}

ManagementAPI provides the type for definition of management API

type Provider

type Provider interface {
	InitializeConfiguration() error
	LoadConfiguration() (*Config, error)
	SaveConfiguration(config Config, overwrite bool) error
	LoadDriverInstance(driverInstanceID string) (*Instance, error)
	GetUaaAuthConfig() (*UaaAuth, error)
	SetInstance(instanceid string, driverInstance Instance) error
	GetInstance(instanceid string) (instance *Instance, driverID string, err error)
	DeleteInstance(instanceid string) error
	SetService(instanceid string, service brokermodel.CatalogService) error
	GetService(serviceid string) (service *brokermodel.CatalogService, instanceid string, err error)
	DeleteService(instanceid string) error
	SetDial(instanceid string, dialid string, dial Dial) error
	GetDial(dialid string) (dial *Dial, instanceID string, err error)
	DeleteDial(dialid string) error
	InstanceNameExists(driverInstanceName string) (bool, error)
	GetPlan(plandid string) (plan *brokermodel.Plan, dialid string, instanceid string, err error)
}

Provider is the definition for a config provider

func NewFileConfig

func NewFileConfig(path string) Provider

NewFileConfig builds and returns a new file config Provider

func NewMysqlConfig

func NewMysqlConfig(address, username, password, database, configPath string, logger lager.Logger) (Provider, error)

NewMysqlConfig generates and returns a new mysql config provider

func NewRedisConfig

func NewRedisConfig(provider redis.Provisioner) Provider

NewRedisConfig generates and returns a new redis config provider

type RoutesRegister

type RoutesRegister struct {
	NatsMembers      []string `json:"nats_members"`
	BrokerAPIHost    string   `json:"broker_api_host,omitempty"`
	ManagmentAPIHost string   `json:"management_api_host,omitempty"`
}

RoutesRegister is the definition for RouteRegister

type Uaa

type Uaa struct {
	UaaAuth UaaAuth `json:"uaa"`
}

Uaa provides the type to use for authentication and authorization

type UaaAuth

type UaaAuth struct {
	Scope                    string `json:"adminscope"`
	PublicKey                string `json:"public_key"`
	SymmetricVerificationKey string `json:"symmetric_verification_key"`
}

UaaAuth provides authentication and authorization definition

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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