Documentation ¶
Index ¶
- Constants
- func CreateIstioObjectsInK8S(configStore ConfigStore, bindingID string, name string, ...) (string, error)
- func SetupRouter(interceptor ServiceBrokerInterceptor, routerConfig Config) *gin.Engine
- func SetupRouterWithVersion(interceptor ServiceBrokerInterceptor, routerConfig Config, vers string) *gin.Engine
- type Config
- type ConfigStore
- type ConsumerInterceptor
- func (c ConsumerInterceptor) HasAdaptCredentials() bool
- func (c ConsumerInterceptor) PostBind(request model.BindRequest, response model.BindResponse, bindID string, ...) (*model.BindResponse, error)
- func (c ConsumerInterceptor) PostCatalog(catalog *model.Catalog) error
- func (c ConsumerInterceptor) PostProvision(request model.ProvisionRequest, response model.ProvisionResponse) (*model.ProvisionResponse, error)
- func (c ConsumerInterceptor) PostUnbind(bindID string)
- func (c ConsumerInterceptor) PreBind(request model.BindRequest) (*model.BindRequest, error)
- func (c ConsumerInterceptor) PreProvision(request model.ProvisionRequest) (*model.ProvisionRequest, error)
- type MockConfigStore
- type ProducerInterceptor
- func (c ProducerInterceptor) HasAdaptCredentials() bool
- func (c ProducerInterceptor) PostBind(request model.BindRequest, response model.BindResponse, bindingID string, ...) (*model.BindResponse, error)
- func (c ProducerInterceptor) PostCatalog(catalog *model.Catalog) error
- func (c ProducerInterceptor) PostProvision(request model.ProvisionRequest, response model.ProvisionResponse) (*model.ProvisionResponse, error)
- func (c ProducerInterceptor) PostUnbind(bindID string)
- func (c ProducerInterceptor) PreBind(request model.BindRequest) (*model.BindRequest, error)
- func (c ProducerInterceptor) PreProvision(request model.ProvisionRequest) (*model.ProvisionRequest, error)
- func (c *ProducerInterceptor) WriteIstioConfigFiles(port int) error
- type ServiceBrokerInterceptor
Constants ¶
const ( // DefaultPort for istio-broker-proxy HTTP endpoint DefaultPort = 8080 // IstioBrokerVersion is a header entry that contains the commit-shas of istio-broker-proxy IstioBrokerVersion = "X-Istio-Broker-Versions" )
Variables ¶
This section is empty.
Functions ¶
func CreateIstioObjectsInK8S ¶
func CreateIstioObjectsInK8S(configStore ConfigStore, bindingID string, name string, endpoint model.Endpoint, systemDomain string) (string, error)
CreateIstioObjectsInK8S create a service and istio routing rules
func SetupRouter ¶
func SetupRouter(interceptor ServiceBrokerInterceptor, routerConfig Config) *gin.Engine
SetupRouter creates the istio-broker-proxy's endpoints
func SetupRouterWithVersion ¶
func SetupRouterWithVersion(interceptor ServiceBrokerInterceptor, routerConfig Config, vers string) *gin.Engine
SetupRouterWithVersion creates the istio-broker-proxy's endpoints
Types ¶
type Config ¶
type Config struct { ForwardURL string SkipVerifyTLS bool Port int HTTPClientFactory func(tr *http.Transport) *http.Client HTTPRequestFactory func(method string, url string, header http.Header, body io.Reader) (*http.Request, error) }
Config contains various config
type ConfigStore ¶
type ConfigStore interface { CreateService(bindingID string, service *v1.Service) (*v1.Service, error) CreateIstioConfig(bindingID string, config []model.Config) error DeleteBinding(bindingID string) error }
ConfigStore encapsulates functions to modify istio config
func NewExternKubeConfigStore ¶
func NewExternKubeConfigStore(namespace string) ConfigStore
NewExternKubeConfigStore creates a new ConfigStore using the KUBECONFIG env variable
func NewFileConfigStore ¶
func NewFileConfigStore(dir string) ConfigStore
NewFileConfigStore returns a new FileConfigStore for a given directory
func NewInClusterConfigStore ¶
func NewInClusterConfigStore() ConfigStore
NewInClusterConfigStore creates a new ConfigStore from within the cluster
func NewMockConfigStore ¶
func NewMockConfigStore() ConfigStore
NewMockConfigStore create a new ConfigStore with mocking capabilities
type ConsumerInterceptor ¶
type ConsumerInterceptor struct { ConsumerID string ConfigStore ConfigStore ServiceNamePrefix string NetworkProfile string }
ConsumerInterceptor contains config for the consumer side
func (ConsumerInterceptor) HasAdaptCredentials ¶
func (c ConsumerInterceptor) HasAdaptCredentials() bool
HasAdaptCredentials see interface definition
func (ConsumerInterceptor) PostBind ¶
func (c ConsumerInterceptor) PostBind(request model.BindRequest, response model.BindResponse, bindID string, adapt func(model.Credentials, []model.EndpointMapping) (*model.BindResponse, error)) (*model.BindResponse, error)
PostBind see interface definition
func (ConsumerInterceptor) PostCatalog ¶
func (c ConsumerInterceptor) PostCatalog(catalog *model.Catalog) error
PostCatalog see interface definition
func (ConsumerInterceptor) PostProvision ¶
func (c ConsumerInterceptor) PostProvision(request model.ProvisionRequest, response model.ProvisionResponse) (*model.ProvisionResponse, error)
PostProvision see interface definition
func (ConsumerInterceptor) PostUnbind ¶
func (c ConsumerInterceptor) PostUnbind(bindID string)
PostUnbind see interface definition
func (ConsumerInterceptor) PreBind ¶
func (c ConsumerInterceptor) PreBind(request model.BindRequest) (*model.BindRequest, error)
PreBind see interface definition
func (ConsumerInterceptor) PreProvision ¶
func (c ConsumerInterceptor) PreProvision(request model.ProvisionRequest) (*model.ProvisionRequest, error)
PreProvision see interface definition
type MockConfigStore ¶
type MockConfigStore struct { CreatedServices []*v1.Service CreatedIstioConfigs []istioModel.Config ClusterIP string CreateServiceErr error CreateObjectErr error CreateObjectErrCount int DeletedServices []string DeletedIstioConfigs []string }
MockConfigStore is the configStore to use in unit test with some spy functionality
func (*MockConfigStore) CreateIstioConfig ¶
func (m *MockConfigStore) CreateIstioConfig(bindingID string, configs []istioModel.Config) error
CreateIstioConfig stores the configs that would be created
func (*MockConfigStore) CreateService ¶
CreateService stores the service that would be created
func (*MockConfigStore) DeleteBinding ¶
func (m *MockConfigStore) DeleteBinding(bindingID string) error
DeleteBinding stores the objects that would have been deleted if they have been created via this store
type ProducerInterceptor ¶
type ProducerInterceptor struct { LoadBalancerPort int SystemDomain string ProviderID string IPAddress string ServiceNamePrefix string PlanMetaData string NetworkProfile string ConfigStore ConfigStore }
ProducerInterceptor contains config for the producer side
func (ProducerInterceptor) HasAdaptCredentials ¶
func (c ProducerInterceptor) HasAdaptCredentials() bool
HasAdaptCredentials see interface definition
func (ProducerInterceptor) PostBind ¶
func (c ProducerInterceptor) PostBind(request model.BindRequest, response model.BindResponse, bindingID string, adapt func(model.Credentials, []model.EndpointMapping) (*model.BindResponse, error)) (*model.BindResponse, error)
PostBind see interface definition
func (ProducerInterceptor) PostCatalog ¶
func (c ProducerInterceptor) PostCatalog(catalog *model.Catalog) error
PostCatalog see interface definition
func (ProducerInterceptor) PostProvision ¶
func (c ProducerInterceptor) PostProvision(request model.ProvisionRequest, response model.ProvisionResponse) (*model.ProvisionResponse, error)
PostProvision see interface definition
func (ProducerInterceptor) PostUnbind ¶
func (c ProducerInterceptor) PostUnbind(bindID string)
PostUnbind see interface definition
func (ProducerInterceptor) PreBind ¶
func (c ProducerInterceptor) PreBind(request model.BindRequest) (*model.BindRequest, error)
PreBind see interface definition
func (ProducerInterceptor) PreProvision ¶
func (c ProducerInterceptor) PreProvision(request model.ProvisionRequest) (*model.ProvisionRequest, error)
PreProvision see interface definition
func (*ProducerInterceptor) WriteIstioConfigFiles ¶
func (c *ProducerInterceptor) WriteIstioConfigFiles(port int) error
WriteIstioConfigFiles creates istio config for control plane route
type ServiceBrokerInterceptor ¶
type ServiceBrokerInterceptor interface { PreProvision(request model.ProvisionRequest) (*model.ProvisionRequest, error) PostProvision(request model.ProvisionRequest, response model.ProvisionResponse) (*model.ProvisionResponse, error) PreBind(request model.BindRequest) (*model.BindRequest, error) PostBind(request model.BindRequest, response model.BindResponse, bindID string, adapt func(model.Credentials, []model.EndpointMapping) (*model.BindResponse, error)) (*model.BindResponse, error) PostUnbind(bindID string) PostCatalog(catalog *model.Catalog) error HasAdaptCredentials() bool }
ServiceBrokerInterceptor specifies methods to modify osb calls
func NewNoOpInterceptor ¶
func NewNoOpInterceptor() ServiceBrokerInterceptor
NewNoOpInterceptor creates an empty ServiceBrokerInterceptor