Documentation
¶
Index ¶
- func LastStatusCondition(si v1beta1.ServiceInstance) v1beta1.ServiceInstanceCondition
- func ParseJSONOrFile(jsonOrFile string) (map[string]interface{}, error)
- func ParseJSONString(jsonString string) (map[string]interface{}, error)
- type BrokerNameOption
- type BrokerNameOptions
- type Client
- func (c *Client) BrokerName(service v1beta1.ServiceInstance, opts ...BrokerNameOption) (string, error)
- func (c *Client) DeleteService(instanceName string, opts ...DeleteServiceOption) error
- func (c *Client) GetService(instanceName string, opts ...GetServiceOption) (*v1beta1.ServiceInstance, error)
- func (c *Client) ListServices(opts ...ListServicesOption) (*v1beta1.ServiceInstanceList, error)
- func (c *Client) Marketplace(opts ...MarketplaceOption) (*KfMarketplace, error)
- type ClientInterface
- type CreateServiceOption
- type CreateServiceOptions
- type DeleteServiceOption
- type DeleteServiceOptions
- type GetServiceOption
- type GetServiceOptions
- type KfMarketplace
- type ListServicesOption
- type ListServicesOptions
- type MarketplaceOption
- type MarketplaceOptions
- type SClientFactory
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LastStatusCondition ¶
func LastStatusCondition(si v1beta1.ServiceInstance) v1beta1.ServiceInstanceCondition
LastStatusCondition returns the last condition based on time.
Example ¶
si := v1beta1.ServiceInstance{ Status: v1beta1.ServiceInstanceStatus{ Conditions: []v1beta1.ServiceInstanceCondition{ {Status: "Wrong"}, {LastTransitionTime: metav1.Time{Time: time.Now()}, Status: "Ready"}, }, }, } c := LastStatusCondition(si) fmt.Println(c.Status)
Output: Ready
func ParseJSONOrFile ¶
ParseJSONOrFile parses the value as JSON if it's valid or else it tries to read the value as a file on the filesystem.
func ParseJSONString ¶
ParseJSONString converts a string of JSON to a Go map.
Types ¶
type BrokerNameOption ¶
type BrokerNameOption func(*brokerNameConfig)
BrokerNameOption is a single option for configuring a brokerNameConfig
func WithBrokerNameNamespace ¶
func WithBrokerNameNamespace(val string) BrokerNameOption
WithBrokerNameNamespace creates an Option that sets the Kubernetes namespace to use.
type BrokerNameOptions ¶
type BrokerNameOptions []BrokerNameOption
BrokerNameOptions is a configuration set defining a brokerNameConfig
func BrokerNameOptionDefaults ¶
func BrokerNameOptionDefaults() BrokerNameOptions
BrokerNameOptionDefaults gets the default values for BrokerName.
func (BrokerNameOptions) Extend ¶
func (opts BrokerNameOptions) Extend(other BrokerNameOptions) BrokerNameOptions
Extend creates a new BrokerNameOptions with the contents of other overriding the values set in this BrokerNameOptions.
func (BrokerNameOptions) Namespace ¶
func (opts BrokerNameOptions) Namespace() string
Namespace returns the last set value for Namespace or the empty value if not set.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an implementation of ClientInterface that works with the Service Catalog.
func (*Client) BrokerName ¶
func (c *Client) BrokerName(service v1beta1.ServiceInstance, opts ...BrokerNameOption) (string, error)
BrokerName fetches the service broker name for a service.
func (*Client) DeleteService ¶
func (c *Client) DeleteService(instanceName string, opts ...DeleteServiceOption) error
DeleteService removes an instance of a service on the cluster.
func (*Client) GetService ¶
func (c *Client) GetService(instanceName string, opts ...GetServiceOption) (*v1beta1.ServiceInstance, error)
GetService gets an instance of a service on the cluster.
func (*Client) ListServices ¶
func (c *Client) ListServices(opts ...ListServicesOption) (*v1beta1.ServiceInstanceList, error)
ListServices lists instances of services on the cluster.
func (*Client) Marketplace ¶
func (c *Client) Marketplace(opts ...MarketplaceOption) (*KfMarketplace, error)
Marketplace lists available services and plans in the marketplace.
type ClientInterface ¶
type ClientInterface interface { // DeleteService removes an instance of a service on the cluster. DeleteService(instanceName string, opts ...DeleteServiceOption) error // GetService gets an instance of a service on the cluster. GetService(instanceName string, opts ...GetServiceOption) (*v1beta1.ServiceInstance, error) // ListServices lists instances of services on the cluster. ListServices(opts ...ListServicesOption) (*v1beta1.ServiceInstanceList, error) // Marketplace lists available services and plans in the marketplace. Marketplace(opts ...MarketplaceOption) (*KfMarketplace, error) // BrokerName fetches the service broker name for a service. BrokerName(service v1beta1.ServiceInstance, opts ...BrokerNameOption) (string, error) }
ClientInterface is a client capable of interacting with service catalog services and mapping the CF to Kubernetes concepts.
func NewClient ¶
func NewClient(sclient SClientFactory) ClientInterface
NewClient creates a new client capable of interacting siwht service catalog services.
type CreateServiceOption ¶
type CreateServiceOption func(*createServiceConfig)
CreateServiceOption is a single option for configuring a createServiceConfig
func WithCreateServiceNamespace ¶
func WithCreateServiceNamespace(val string) CreateServiceOption
WithCreateServiceNamespace creates an Option that sets the Kubernetes namespace to use.
func WithCreateServiceParams ¶
func WithCreateServiceParams(val map[string]interface{}) CreateServiceOption
WithCreateServiceParams creates an Option that sets service-specific configuration parameters.
type CreateServiceOptions ¶
type CreateServiceOptions []CreateServiceOption
CreateServiceOptions is a configuration set defining a createServiceConfig
func CreateServiceOptionDefaults ¶
func CreateServiceOptionDefaults() CreateServiceOptions
CreateServiceOptionDefaults gets the default values for CreateService.
func (CreateServiceOptions) Extend ¶
func (opts CreateServiceOptions) Extend(other CreateServiceOptions) CreateServiceOptions
Extend creates a new CreateServiceOptions with the contents of other overriding the values set in this CreateServiceOptions.
func (CreateServiceOptions) Namespace ¶
func (opts CreateServiceOptions) Namespace() string
Namespace returns the last set value for Namespace or the empty value if not set.
func (CreateServiceOptions) Params ¶
func (opts CreateServiceOptions) Params() map[string]interface{}
Params returns the last set value for Params or the empty value if not set.
type DeleteServiceOption ¶
type DeleteServiceOption func(*deleteServiceConfig)
DeleteServiceOption is a single option for configuring a deleteServiceConfig
func WithDeleteServiceNamespace ¶
func WithDeleteServiceNamespace(val string) DeleteServiceOption
WithDeleteServiceNamespace creates an Option that sets the Kubernetes namespace to use.
type DeleteServiceOptions ¶
type DeleteServiceOptions []DeleteServiceOption
DeleteServiceOptions is a configuration set defining a deleteServiceConfig
func DeleteServiceOptionDefaults ¶
func DeleteServiceOptionDefaults() DeleteServiceOptions
DeleteServiceOptionDefaults gets the default values for DeleteService.
func (DeleteServiceOptions) Extend ¶
func (opts DeleteServiceOptions) Extend(other DeleteServiceOptions) DeleteServiceOptions
Extend creates a new DeleteServiceOptions with the contents of other overriding the values set in this DeleteServiceOptions.
func (DeleteServiceOptions) Namespace ¶
func (opts DeleteServiceOptions) Namespace() string
Namespace returns the last set value for Namespace or the empty value if not set.
type GetServiceOption ¶
type GetServiceOption func(*getServiceConfig)
GetServiceOption is a single option for configuring a getServiceConfig
func WithGetServiceNamespace ¶
func WithGetServiceNamespace(val string) GetServiceOption
WithGetServiceNamespace creates an Option that sets the Kubernetes namespace to use.
type GetServiceOptions ¶
type GetServiceOptions []GetServiceOption
GetServiceOptions is a configuration set defining a getServiceConfig
func GetServiceOptionDefaults ¶
func GetServiceOptionDefaults() GetServiceOptions
GetServiceOptionDefaults gets the default values for GetService.
func (GetServiceOptions) Extend ¶
func (opts GetServiceOptions) Extend(other GetServiceOptions) GetServiceOptions
Extend creates a new GetServiceOptions with the contents of other overriding the values set in this GetServiceOptions.
func (GetServiceOptions) Namespace ¶
func (opts GetServiceOptions) Namespace() string
Namespace returns the last set value for Namespace or the empty value if not set.
type KfMarketplace ¶
type KfMarketplace struct { Services []servicecatalog.Class Plans []servicecatalog.Plan }
KfMarketplace contains information to describe the services and plans available in the catalog.
type ListServicesOption ¶
type ListServicesOption func(*listServicesConfig)
ListServicesOption is a single option for configuring a listServicesConfig
func WithListServicesNamespace ¶
func WithListServicesNamespace(val string) ListServicesOption
WithListServicesNamespace creates an Option that sets the Kubernetes namespace to use.
type ListServicesOptions ¶
type ListServicesOptions []ListServicesOption
ListServicesOptions is a configuration set defining a listServicesConfig
func ListServicesOptionDefaults ¶
func ListServicesOptionDefaults() ListServicesOptions
ListServicesOptionDefaults gets the default values for ListServices.
func (ListServicesOptions) Extend ¶
func (opts ListServicesOptions) Extend(other ListServicesOptions) ListServicesOptions
Extend creates a new ListServicesOptions with the contents of other overriding the values set in this ListServicesOptions.
func (ListServicesOptions) Namespace ¶
func (opts ListServicesOptions) Namespace() string
Namespace returns the last set value for Namespace or the empty value if not set.
type MarketplaceOption ¶
type MarketplaceOption func(*marketplaceConfig)
MarketplaceOption is a single option for configuring a marketplaceConfig
func WithMarketplaceNamespace ¶
func WithMarketplaceNamespace(val string) MarketplaceOption
WithMarketplaceNamespace creates an Option that sets the Kubernetes namespace to use.
type MarketplaceOptions ¶
type MarketplaceOptions []MarketplaceOption
MarketplaceOptions is a configuration set defining a marketplaceConfig
func MarketplaceOptionDefaults ¶
func MarketplaceOptionDefaults() MarketplaceOptions
MarketplaceOptionDefaults gets the default values for Marketplace.
func (MarketplaceOptions) Extend ¶
func (opts MarketplaceOptions) Extend(other MarketplaceOptions) MarketplaceOptions
Extend creates a new MarketplaceOptions with the contents of other overriding the values set in this MarketplaceOptions.
func (MarketplaceOptions) Namespace ¶
func (opts MarketplaceOptions) Namespace() string
Namespace returns the last set value for Namespace or the empty value if not set.
type SClientFactory ¶
type SClientFactory func(namespace string) servicecatalog.SvcatClient
SClientFactory creates a Service Catalog client.