aiven

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInstanceDoesNotExist = errors.New("Error deleting service: service instance does not exist")

Functions

This section is empty.

Types

type AivenErrorResponse

type AivenErrorResponse struct {
	Errors []struct {
		Message string `json:"message"`
		Status  int    `json:"status"`
	} `json:"errors"`
	Message string `json:"message"`
}

type Client

type Client interface {
	CreateService(params *CreateServiceInput) (string, error)
	GetServiceStatus(params *GetServiceInput) (ServiceStatus, time.Time, error)
	GetServiceConnectionDetails(params *GetServiceInput) (string, string, error)
	DeleteService(params *DeleteServiceInput) error
	CreateServiceUser(params *CreateServiceUserInput) (string, error)
	DeleteServiceUser(params *DeleteServiceUserInput) (string, error)
	UpdateService(params *UpdateServiceInput) (string, error)
}

type CreateServiceInput

type CreateServiceInput struct {
	Cloud       string     `json:"cloud,omitempty"`
	GroupName   string     `json:"group_name,omitempty"`
	Plan        string     `json:"plan,omitempty"`
	ServiceName string     `json:"service_name"`
	ServiceType string     `json:"service_type"`
	UserConfig  UserConfig `json:"user_config"`
}

type CreateServiceUserInput

type CreateServiceUserInput struct {
	ServiceName string `json:"-"`
	Username    string `json:"username"`
}

type CreateServiceUserResponse

type CreateServiceUserResponse struct {
	Message string `json:"message"`
	User    User   `json:"user"`
}

type DeleteServiceInput

type DeleteServiceInput struct {
	ServiceName string
}

type DeleteServiceUserInput

type DeleteServiceUserInput struct {
	ServiceName string
	Username    string
}

type ErrInvalidUpdate

type ErrInvalidUpdate struct {
	Message string
}

func (ErrInvalidUpdate) Error

func (p ErrInvalidUpdate) Error() string

type GetServiceInput

type GetServiceInput struct {
	ServiceName string
}

type GetServiceResponse

type GetServiceResponse struct {
	Service Service `json:"service"`
}

type HttpClient

type HttpClient struct {
	BaseURL    string
	Token      string
	Project    string
	HTTPClient *http.Client
}

func NewHttpClient

func NewHttpClient(baseURL, token, project string) *HttpClient

func (*HttpClient) CreateService

func (a *HttpClient) CreateService(params *CreateServiceInput) (string, error)

func (*HttpClient) CreateServiceUser

func (a *HttpClient) CreateServiceUser(params *CreateServiceUserInput) (string, error)

func (*HttpClient) DeleteService

func (a *HttpClient) DeleteService(params *DeleteServiceInput) error

func (*HttpClient) DeleteServiceUser

func (a *HttpClient) DeleteServiceUser(params *DeleteServiceUserInput) (string, error)

func (*HttpClient) GetServiceConnectionDetails

func (a *HttpClient) GetServiceConnectionDetails(params *GetServiceInput) (string, string, error)

func (*HttpClient) GetServiceStatus

func (a *HttpClient) GetServiceStatus(params *GetServiceInput) (ServiceStatus, time.Time, error)

func (*HttpClient) UpdateService

func (a *HttpClient) UpdateService(params *UpdateServiceInput) (string, error)

type Service

type Service struct {
	State            ServiceStatus    `json:"state"`
	UpdateTime       time.Time        `json:"update_time"`
	ServiceUriParams ServiceUriParams `json:"service_uri_params"`
}

type ServiceStatus

type ServiceStatus string
const (
	Running     ServiceStatus = "RUNNING"
	Rebuilding  ServiceStatus = "REBUILDING"
	Rebalancing ServiceStatus = "REBALANCING"
	PowerOff    ServiceStatus = "POWEROFF"
)

type ServiceUriParams

type ServiceUriParams struct {
	Host     string `json:"host"`
	Password string `json:"password"`
	Port     string `json:"port"`
	User     string `json:"user"`
}

type UpdateServiceInput

type UpdateServiceInput struct {
	ServiceName string     `json:"-"`
	Plan        string     `json:"plan,omitempty"`
	UserConfig  UserConfig `json:"user_config"`
}

type User

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

type UserConfig

type UserConfig struct {
	ElasticsearchVersion string   `json:"elasticsearch_version"`
	IPFilter             []string `json:"ip_filter,omitempty"`
}

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