config

package
v0.0.0-...-fb356ce Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PlanEnabled       = CFServiceAccess("enable")
	PlanDisabled      = CFServiceAccess("disable")
	PlanOrgRestricted = CFServiceAccess("org-restricted")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthHeaderBuilder

type AuthHeaderBuilder interface {
	AddAuthHeader(request *http.Request, logger *log.Logger) error
}

type Authentication

type Authentication struct {
	Basic UserCredentials
	UAA   UAAAuthentication
}

func (Authentication) Validate

func (a Authentication) Validate(URLRequired bool) error

type BindingDNS

type BindingDNS struct {
	Name          string               `yaml:"name"`
	LinkProvider  string               `yaml:"link_provider"`
	InstanceGroup string               `yaml:"instance_group"`
	Properties    BindingDNSProperties `yaml:"properties"`
}

type BindingDNSProperties

type BindingDNSProperties struct {
	AZS    []string `yaml:"azs"`
	Status string   `yaml:"status"`
}

type Bosh

type Bosh struct {
	URL            string `yaml:"url"`
	TrustedCert    string `yaml:"root_ca_cert"`
	Authentication Authentication
}

TODO: Refactor BOSH Authentication structure to look like CF one

func (Bosh) NewAuthHeaderBuilder

func (boshConfig Bosh) NewAuthHeaderBuilder(UAAURL string, disableSSLCertVerification bool) (AuthHeaderBuilder, error)

func (Bosh) Validate

func (b Bosh) Validate() error

type BoshCredhub

type BoshCredhub struct {
	URL            string `yaml:"url"`
	RootCACert     string `yaml:"root_ca_cert"`
	Authentication Authentication
}

type Broker

type Broker struct {
	Port                       int       `yaml:"port"`
	Username                   string    `yaml:"username"`
	Password                   string    `yaml:"password"`
	DisableSSLCertVerification bool      `yaml:"disable_ssl_cert_verification"`
	DisableBoshConfigs         bool      `yaml:"disable_bosh_configs"`
	StartUpBanner              bool      `yaml:"startup_banner"`
	ShutdownTimeoutSecs        int       `yaml:"shutdown_timeout_in_seconds"`
	DisableCFStartupChecks     bool      `yaml:"disable_cf_startup_checks"`
	ExposeOperationalErrors    bool      `yaml:"expose_operational_errors"`
	EnablePlanSchemas          bool      `yaml:"enable_plan_schemas"`
	UsingStdin                 bool      `yaml:"use_stdin"`
	EnableSecureManifests      bool      `yaml:"enable_secure_manifests"`
	EnableTelemetry            bool      `yaml:"enable_telemetry"`
	EnableOptimisedUpgrades    bool      `yaml:"enable_optimised_upgrades"`
	SupportBackupAgentBinding  bool      `yaml:"support_backup_agent_binding"`
	TLS                        TLSConfig `yaml:"tls"`
}

func (Broker) Validate

func (b Broker) Validate() error

type BrokerAPI

type BrokerAPI struct {
	URL            string          `yaml:"url"`
	Authentication Authentication  `yaml:"authentication"`
	TLS            ErrandTLSConfig `yaml:"tls"`
}

type CF

type CF struct {
	URL                        string
	TrustedCert                string    `yaml:"root_ca_cert"`
	UAA                        UAAConfig `yaml:"uaa"`
	DisableSSLCertVerification bool      `yaml:"disable_ssl_cert_verification"`
}

func (CF) NewAuthHeaderBuilder

func (cf CF) NewAuthHeaderBuilder(disableSSLCertVerification bool) (AuthHeaderBuilder, error)

func (CF) Validate

func (cf CF) Validate() error

type CFServiceAccess

type CFServiceAccess string

type CanarySelectionParams

type CanarySelectionParams map[string]string

func (CanarySelectionParams) String

func (filter CanarySelectionParams) String() string

type ClientCredentials

type ClientCredentials struct {
	ID     string `yaml:"client_id"`
	Secret string `yaml:"client_secret"`
}

func (ClientCredentials) IsSet

func (cc ClientCredentials) IsSet() bool

func (ClientCredentials) Validate

func (c ClientCredentials) Validate() error

type ClientDefinition

type ClientDefinition struct {
	Authorities          string `yaml:"authorities"`
	AuthorizedGrantTypes string `yaml:"authorized_grant_types"`
	ResourceIDs          string `yaml:"resource_ids"`
	Scopes               string `yaml:"scopes"`
	Name                 string `yaml:"name"`
	AllowPublic          bool   `yaml:"allowpublic"`
}

type Config

type Config struct {
	Broker              Broker
	Bosh                Bosh
	CF                  CF
	ServiceInstancesAPI ServiceInstancesAPI `yaml:"service_instances_api"`
	CredHub             CredHub             `yaml:"credhub"`
	ServiceAdapter      ServiceAdapter      `yaml:"service_adapter"`
	ServiceDeployment   ServiceDeployment   `yaml:"service_deployment"`
	ServiceCatalog      ServiceOffering     `yaml:"service_catalog"`
	BoshCredhub         BoshCredhub         `yaml:"bosh_credhub"`
}

func Parse

func Parse(configFilePath string) (Config, error)

func (Config) HasBindingWithDNSConfigured

func (c Config) HasBindingWithDNSConfigured() bool

func (Config) HasRuntimeCredHub

func (c Config) HasRuntimeCredHub() bool

func (Config) HasTLS

func (c Config) HasTLS() bool

func (Config) Validate

func (c Config) Validate() error

type CredHub

type CredHub struct {
	APIURL            string `yaml:"api_url"`
	ClientID          string `yaml:"client_id"`
	ClientSecret      string `yaml:"client_secret"`
	CaCert            string `yaml:"ca_cert"`
	InternalUAACaCert string `yaml:"internal_uaa_ca_cert"`
}

type DashboardClient

type DashboardClient struct {
	ID          string
	Secret      string
	RedirectUri string `yaml:"redirect_uri"`
}

type Errand

type Errand struct {
	Name      string
	Instances []string
}

type ErrandTLSConfig

type ErrandTLSConfig struct {
	CACert                     string `yaml:"ca_cert"`
	DisableSSLCertVerification bool   `yaml:"disable_ssl_cert_verification"`
}

type FieldError

type FieldError struct {
	Field string
	Msg   string
}

func (FieldError) Error

func (f FieldError) Error() string

type InstanceIteratorConfig

type InstanceIteratorConfig struct {
	BrokerAPI              BrokerAPI             `yaml:"broker_api"`
	PollingInterval        int                   `yaml:"polling_interval"`
	AttemptInterval        int                   `yaml:"attempt_interval"`
	AttemptLimit           int                   `yaml:"attempt_limit"`
	RequestTimeout         int                   `yaml:"request_timeout"`
	MaxInFlight            int                   `yaml:"max_in_flight"`
	Canaries               int                   `yaml:"canaries"`
	CanarySelectionParams  CanarySelectionParams `yaml:"canary_selection_params"`
	Bosh                   Bosh                  `yaml:"bosh"`
	CF                     CF                    `yaml:"cf"`
	MaintenanceInfoPresent bool                  `yaml:"maintenance_info_present"`
}

type MaintenanceInfo

type MaintenanceInfo struct {
	Public      map[string]string `yaml:"public,omitempty"`
	Private     map[string]string `yaml:"private,omitempty"`
	Version     string            `yaml:"version,omitempty"`
	Description string            `yaml:"description,omitempty"`
}

type OrphanDeploymentsErrandConfig

type OrphanDeploymentsErrandConfig struct {
	BrokerAPI BrokerAPI `yaml:"broker_api"`
}

type Plan

type Plan struct {
	ID               string `yaml:"plan_id"`
	Name             string
	Free             *bool
	Bindable         *bool
	Description      string
	Metadata         PlanMetadata
	Quotas           Quotas `yaml:"quotas,omitempty"`
	Properties       serviceadapter.Properties
	InstanceGroups   []serviceadapter.InstanceGroup   `yaml:"instance_groups,omitempty"`
	Update           *serviceadapter.Update           `yaml:"update,omitempty"`
	LifecycleErrands *serviceadapter.LifecycleErrands `yaml:"lifecycle_errands,omitempty"`
	BindingWithDNS   []BindingDNS                     `yaml:"binding_with_dns"`
	MaintenanceInfo  *MaintenanceInfo                 `yaml:"maintenance_info,omitempty"`
}

func (Plan) AdapterPlan

func (p Plan) AdapterPlan(globalProperties serviceadapter.Properties) serviceadapter.Plan

func (Plan) PostDeployErrands

func (p Plan) PostDeployErrands() []Errand

func (Plan) PreDeleteErrands

func (p Plan) PreDeleteErrands() []Errand

type PlanAccess

type PlanAccess struct {
	Name             string          `yaml:"name"`
	ServiceAccessOrg string          `yaml:"service_access_org"`
	CFServiceAccess  CFServiceAccess `yaml:"cf_service_access"`
}

type PlanCost

type PlanCost struct {
	Amount map[string]float64 `yaml:"amount"`
	Unit   string             `yaml:"unit"`
}

type PlanMetadata

type PlanMetadata struct {
	DisplayName        string                 `yaml:"display_name"`
	Bullets            []string               `yaml:"bullets,omitempty"`
	Costs              []PlanCost             `yaml:"costs"`
	AdditionalMetadata map[string]interface{} `yaml:"additional_metadata,inline,omitempty"`
}

type Plans

type Plans []Plan

func (Plans) FindByID

func (p Plans) FindByID(id string) (Plan, bool)

type Quotas

type Quotas struct {
	ServiceInstanceLimit *int                     `yaml:"service_instance_limit,omitempty"`
	Resources            map[string]ResourceQuota `yaml:"resources,omitempty"`
}

type RegisterBrokerErrandConfig

type RegisterBrokerErrandConfig struct {
	BrokerName        string       `yaml:"broker_name"`
	BrokerUsername    string       `yaml:"broker_username"`
	BrokerPassword    string       `yaml:"broker_password"`
	BrokerURL         string       `yaml:"broker_url"`
	CF                CF           `yaml:"cf"`
	ServiceOfferingID string       `yaml:"service_offering_id"`
	Plans             []PlanAccess `yaml:"plans"`
}

type ResourceQuota

type ResourceQuota struct {
	Limit int `yaml:"limit,omitempty"`
	Cost  int `yaml:"cost,omitempty"`
}

type ServiceAdapter

type ServiceAdapter struct {
	Path string
}

type ServiceDeployment

type ServiceDeployment struct {
	Releases  serviceadapter.ServiceReleases
	Stemcells []serviceadapter.Stemcell
}

func (ServiceDeployment) Validate

func (s ServiceDeployment) Validate() error

type ServiceInstancesAPI

type ServiceInstancesAPI struct {
	URL                        string         `yaml:"url"`
	RootCACert                 string         `yaml:"root_ca_cert"`
	Authentication             Authentication `yaml:"authentication"`
	DisableSSLCertVerification bool           `yaml:"disable_ssl_cert_verification"`
}

type ServiceMetadata

type ServiceMetadata struct {
	DisplayName         string                 `yaml:"display_name"`
	ImageURL            string                 `yaml:"image_url"`
	LongDescription     string                 `yaml:"long_description"`
	ProviderDisplayName string                 `yaml:"provider_display_name"`
	DocumentationURL    string                 `yaml:"documentation_url"`
	SupportURL          string                 `yaml:"support_url"`
	Shareable           bool                   `yaml:"shareable"`
	AdditionalMetadata  map[string]interface{} `yaml:"additional_metadata,inline,omitempty"`
}

type ServiceOffering

type ServiceOffering struct {
	ID               string
	Name             string `yaml:"service_name"`
	Description      string `yaml:"service_description"`
	Bindable         bool
	PlanUpdatable    bool     `yaml:"plan_updatable"`
	Requires         []string `yaml:"requires,omitempty"`
	Metadata         ServiceMetadata
	DashboardClient  *DashboardClient `yaml:"dashboard_client,omitempty"`
	Tags             []string
	GlobalProperties serviceadapter.Properties `yaml:"global_properties"`
	GlobalQuotas     Quotas                    `yaml:"global_quotas"`
	Plans            Plans
	MaintenanceInfo  *MaintenanceInfo `yaml:"maintenance_info,omitempty"`
}

func (ServiceOffering) FindPlanByID

func (s ServiceOffering) FindPlanByID(id string) (Plan, bool)

func (ServiceOffering) HasLifecycleErrands

func (s ServiceOffering) HasLifecycleErrands() bool

func (ServiceOffering) Validate

func (s ServiceOffering) Validate() error

type TLSConfig

type TLSConfig struct {
	CertFile string `yaml:"cert_file"`
	KeyFile  string `yaml:"key_file"`
}

type UAAAuthentication

type UAAAuthentication struct {
	URL               string
	ClientCredentials ClientCredentials `yaml:"client_credentials"`
	UserCredentials   UserCredentials   `yaml:"user_credentials"`
}

func (UAAAuthentication) IsSet

func (cc UAAAuthentication) IsSet() bool

func (UAAAuthentication) Validate

func (a UAAAuthentication) Validate(URLRequired bool) error

type UAAConfig

type UAAConfig struct {
	URL              string           `yaml:"url"`
	ClientDefinition ClientDefinition `yaml:"client_definition"`
	Authentication   UAACredentials   `yaml:"authentication"`
}

type UAACredentials

type UAACredentials struct {
	ClientCredentials ClientCredentials `yaml:"client_credentials"`
	UserCredentials   UserCredentials   `yaml:"user_credentials"`
}

type UserCredentials

type UserCredentials struct {
	Username string
	Password string
}

func (UserCredentials) IsSet

func (c UserCredentials) IsSet() bool

func (UserCredentials) Validate

func (b UserCredentials) Validate() error

Jump to

Keyboard shortcuts

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