provider

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const AIVEN_BASE_URL string = "https://api.aiven.io"

Variables

This section is empty.

Functions

func ParseIPWhitelist

func ParseIPWhitelist(ips string) ([]string, error)

Types

type AivenProvider

type AivenProvider struct {
	Client aiven.Client
	Config *Config
}

func New

func New(configJSON []byte) (*AivenProvider, error)

func (*AivenProvider) Bind

func (ap *AivenProvider) Bind(ctx context.Context, bindData BindData) (binding brokerapi.Binding, err error)

func (*AivenProvider) Deprovision

func (ap *AivenProvider) Deprovision(ctx context.Context, deprovisionData DeprovisionData) (operationData string, err error)

func (*AivenProvider) LastOperation

func (ap *AivenProvider) LastOperation(
	ctx context.Context,
	lastOperationData LastOperationData,
) (state brokerapi.LastOperationState, description string, err error)

func (*AivenProvider) Provision

func (ap *AivenProvider) Provision(ctx context.Context, provisionData ProvisionData) (dashboardURL, operationData string, err error)

func (*AivenProvider) Unbind

func (ap *AivenProvider) Unbind(ctx context.Context, unbindData UnbindData) (err error)

func (*AivenProvider) Update

func (ap *AivenProvider) Update(ctx context.Context, updateData UpdateData) (operationData string, err error)

type AivenServiceCommonConfig added in v0.22.0

type AivenServiceCommonConfig struct{}

type AivenServiceElasticsearchConfig added in v0.22.0

type AivenServiceElasticsearchConfig struct {
	ElasticsearchVersion string `json:"elasticsearch_version"`
}

type AivenServiceInfluxDBConfig added in v0.22.0

type AivenServiceInfluxDBConfig struct{}

type BindData

type BindData struct {
	InstanceID string
	BindingID  string
	Details    brokerapi.BindDetails
}

type Catalog

type Catalog struct {
	Services []Service `json:"services"`
}

type CommonCredentials added in v0.22.0

type CommonCredentials struct {
	URI      string `json:"uri"`
	Hostname string `json:"hostname"`
	Port     string `json:"port"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type Config

type Config struct {
	Cloud             string `json:"cloud"`
	ServiceNamePrefix string
	APIToken          string
	Project           string
	Catalog           Catalog `json:"catalog"`
}

func DecodeConfig

func DecodeConfig(b []byte) (*Config, error)

func (*Config) FindPlan

func (c *Config) FindPlan(serviceId, planId string) (*Plan, error)

type Credentials

type Credentials struct {
	CommonCredentials

	InfluxDBCredentials
}

func BuildCredentials added in v0.22.0

func BuildCredentials(
	serviceType string,
	username string,
	password string,
	hostname string,
	port string,
) (Credentials, error)

type DeprovisionData

type DeprovisionData struct {
	InstanceID string
	Details    brokerapi.DeprovisionDetails
	Service    brokerapi.Service
	Plan       brokerapi.ServicePlan
}

type InfluxDBCredentials added in v0.22.0

type InfluxDBCredentials struct {
	InfluxDBPrometheus *InfluxDBPrometheusCredentials `json:"prometheus,omitempty"`
}

type InfluxDBPrometheusBasicAuthCredentials added in v0.22.0

type InfluxDBPrometheusBasicAuthCredentials struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type InfluxDBPrometheusCredentials added in v0.22.0

type InfluxDBPrometheusCredentials struct {
	RemoteRead  []InfluxDBPrometheusRemoteCredentials `json:"remote_read"`
	RemoteWrite []InfluxDBPrometheusRemoteCredentials `json:"remote_write"`
}

type InfluxDBPrometheusRemoteCredentials added in v0.22.0

type InfluxDBPrometheusRemoteCredentials struct {
	URL                  string                                 `json:"url"`
	BasicAuthCredentials InfluxDBPrometheusBasicAuthCredentials `json:"basic_auth"`
}

type LastOperationData

type LastOperationData struct {
	InstanceID    string
	OperationData string
}

type Plan

type PlanSpecificConfig

type PlanSpecificConfig struct {
	AivenPlan string `json:"aiven_plan"`

	AivenServiceCommonConfig
	AivenServiceElasticsearchConfig
	AivenServiceInfluxDBConfig
}

type ProvisionData

type ProvisionData struct {
	InstanceID string
	Details    brokerapi.ProvisionDetails
	Service    brokerapi.Service
	Plan       brokerapi.ServicePlan
}

type Service

type Service struct {
	brokerapi.Service
	Plans []Plan `json:"plans"`
}

type ServiceProvider

type ServiceProvider interface {
	Provision(context.Context, ProvisionData) (dashboardURL, operationData string, err error)
	Deprovision(context.Context, DeprovisionData) (operationData string, err error)
	Bind(context.Context, BindData) (binding brokerapi.Binding, err error)
	Unbind(context.Context, UnbindData) (err error)
	Update(context.Context, UpdateData) (operationData string, err error)
	LastOperation(context.Context, LastOperationData) (state brokerapi.LastOperationState, description string, err error)
}

type UnbindData

type UnbindData struct {
	InstanceID string
	BindingID  string
	Details    brokerapi.UnbindDetails
}

type UpdateData

type UpdateData struct {
	InstanceID string
	Details    brokerapi.UpdateDetails
	Service    brokerapi.Service
	Plan       brokerapi.ServicePlan
}

Directories

Path Synopsis
fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
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