platform

package
Version: v0.11.20 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrokerClient added in v0.2.0

type BrokerClient interface {
	// GetBrokers obtains the registered brokers in the platform
	GetBrokers(ctx context.Context) ([]*ServiceBroker, error)

	// GetBrokerByName returns the broker from the platform with the specified name
	GetBrokerByName(ctx context.Context, name string) (*ServiceBroker, error)

	// CreateBroker registers a new broker at the platform
	CreateBroker(ctx context.Context, r *CreateServiceBrokerRequest) (*ServiceBroker, error)

	// DeleteBroker unregisters a broker from the platform
	DeleteBroker(ctx context.Context, r *DeleteServiceBrokerRequest) error

	// UpdateBroker updates a broker registration at the platform
	UpdateBroker(ctx context.Context, r *UpdateServiceBrokerRequest) (*ServiceBroker, error)
}

BrokerClient provides the logic for calling into the underlying platform and performing platform specific operations

type BrokerPlatformNameProvider added in v0.11.9

type BrokerPlatformNameProvider interface {
	// GetBrokerPlatformName obtains the broker name in the platform
	GetBrokerPlatformName(name string) string
}

BrokerPlatformNameProvider provides the resource name in the platform, according to how the platform enforces it (e.g k8s not allowing upper case letters)

type Caching added in v0.8.2

type Caching interface {

	// ResetCache invalidates the whole cache
	ResetCache(ctx context.Context) error

	// ResetBroker resets the data for the given broker
	ResetBroker(ctx context.Context, broker *ServiceBroker, deleted bool) error
}

Caching provides cache control

type CatalogFetcher

type CatalogFetcher interface {

	// Fetch contains the logic for platform specific catalog fetching for the broker defined in the update request
	Fetch(ctx context.Context, r *UpdateServiceBrokerRequest) error
}

CatalogFetcher provides a way to add a hook for platform specific way of refetching the service broker catalog on each run of the registration task. If the platform that this proxy represents already handles that, you don't have to implement this interface

type Client

type Client interface {
	// Broker returns a BrokerClient which handles platform specific broker operations
	Broker() BrokerClient
	// Visibility returns a VisibilityClient which handles platform specific service visibility operations
	Visibility() VisibilityClient
	// CatalogFetcher returns a CatalogFetcher which handles platform specific fetching of service catalogs
	CatalogFetcher() CatalogFetcher
}

Client is an interface for service related operations on a platform. If a platform does not support some operations they should return nil for the specific client.

type CreateServiceBrokerRequest

type CreateServiceBrokerRequest struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	BrokerURL string `json:"broker_url"`
	Username  string `json:"username"`
	Password  string `json:"password"`
}

CreateServiceBrokerRequest type used for requests by the platform client

type DeleteServiceBrokerRequest

type DeleteServiceBrokerRequest struct {
	ID   string `json:"id"`
	GUID string `json:"guid"`
	Name string `json:"name"`
}

DeleteServiceBrokerRequest type used for requests by the platform client

type ModifyPlanAccessRequest added in v0.4.0

type ModifyPlanAccessRequest struct {
	BrokerName    string       `json:"broker_name"`
	CatalogPlanID string       `json:"catalog_plan_id"`
	Labels        types.Labels `json:"labels"`
}

ModifyPlanAccessRequest type used for requests by the platform client

type ServiceBroker

type ServiceBroker struct {
	GUID      string `json:"guid"`
	Name      string `json:"name"`
	BrokerURL string `json:"broker_url"`
}

ServiceBroker type for responses from the platform client

type UpdateServiceBrokerRequest

type UpdateServiceBrokerRequest struct {
	ID        string `json:"id"`
	GUID      string `json:"guid"`
	Name      string `json:"name"`
	BrokerURL string `json:"broker_url"`
	Username  string `json:"username"`
	Password  string `json:"password"`
}

UpdateServiceBrokerRequest type used for requests by the platform client

type Visibility added in v0.4.0

type Visibility struct {
	Public             bool
	CatalogPlanID      string
	PlatformBrokerName string
	Labels             map[string]string
}

Visibility generic visibility entity

type VisibilityClient added in v0.2.0

type VisibilityClient interface {
	// GetVisibilitiesByBrokers get currently available visibilities in the platform for specific broker names
	GetVisibilitiesByBrokers(context.Context, []string) ([]*Visibility, error)

	// VisibilityScopeLabelKey returns a specific label key which should be used when converting SM visibilities to platform.Visibilities
	VisibilityScopeLabelKey() string

	// EnableAccessForPlan enables the access for the specified plan
	EnableAccessForPlan(ctx context.Context, request *ModifyPlanAccessRequest) error

	// DisableAccessForPlan disables the access for the specified plan
	DisableAccessForPlan(ctx context.Context, request *ModifyPlanAccessRequest) error
}

VisibilityClient interface for platform clients to implement if they support platform specific service and plan visibilities

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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