cfmysql

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2017 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const SLEEP_TIME = 100

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiClient

type ApiClient interface {
	GetServiceBindings(cliConnection plugin.CliConnection) ([]pluginModels.ServiceBinding, error)
	GetServiceInstances(cliConnection plugin.CliConnection) ([]pluginModels.ServiceInstance, error)
	GetStartedApps(cliConnection plugin.CliConnection) ([]sdkModels.GetAppsModel, error)
}

type ApiClientImpl added in v1.3.4

type ApiClientImpl struct {
	HttpClient Http
}

func NewApiClient added in v1.3.4

func NewApiClient() *ApiClientImpl

func (*ApiClientImpl) GetServiceBindings added in v1.3.5

func (self *ApiClientImpl) GetServiceBindings(cliConnection plugin.CliConnection) ([]pluginModels.ServiceBinding, error)

func (*ApiClientImpl) GetServiceInstances added in v1.3.4

func (self *ApiClientImpl) GetServiceInstances(cliConnection plugin.CliConnection) ([]pluginModels.ServiceInstance, error)

func (*ApiClientImpl) GetStartedApps added in v1.3.4

func (self *ApiClientImpl) GetStartedApps(cliConnection plugin.CliConnection) ([]sdkModels.GetAppsModel, error)

type BindingResult added in v1.3.1

type BindingResult struct {
	Bindings []pluginModels.ServiceBinding
	Err      error
}

type CfService added in v1.3.4

type CfService interface {
	GetMysqlServices(cliConnection plugin.CliConnection) ([]MysqlService, error)
	GetStartedApps(cliConnection plugin.CliConnection) ([]sdkModels.GetAppsModel, error)
	OpenSshTunnel(cliConnection plugin.CliConnection, toService MysqlService, throughApp string, localPort int)
}

type CfServiceImpl added in v1.3.4

type CfServiceImpl struct {
	ApiClient  ApiClient
	HttpClient Http
	PortWaiter PortWaiter
	SshRunner  SshRunner
}

func NewCfService added in v1.3.4

func NewCfService() *CfServiceImpl

func (*CfServiceImpl) GetMysqlServices added in v1.3.4

func (self *CfServiceImpl) GetMysqlServices(cliConnection plugin.CliConnection) ([]MysqlService, error)

func (*CfServiceImpl) GetStartedApps added in v1.3.4

func (self *CfServiceImpl) GetStartedApps(cliConnection plugin.CliConnection) ([]sdkModels.GetAppsModel, error)

func (*CfServiceImpl) OpenSshTunnel added in v1.3.4

func (self *CfServiceImpl) OpenSshTunnel(cliConnection plugin.CliConnection, toService MysqlService, throughApp string, localPort int)

type CfSshRunner

type CfSshRunner struct{}

func (*CfSshRunner) OpenSshTunnel

func (self *CfSshRunner) OpenSshTunnel(cliConnection plugin.CliConnection, toService MysqlService, throughApp string, localPort int)

type Exec

type Exec interface {
	LookPath(file string) (string, error)
	Run(*exec.Cmd) error
}

type ExecWrapper

type ExecWrapper struct{}

func (*ExecWrapper) LookPath

func (self *ExecWrapper) LookPath(file string) (string, error)

func (*ExecWrapper) Run

func (self *ExecWrapper) Run(cmd *exec.Cmd) error

type FreePortFinder

type FreePortFinder struct{}

func (*FreePortFinder) GetPort

func (self *FreePortFinder) GetPort() int

type Http added in v1.3.1

type Http interface {
	Get(endpoint string, access_token string, skipSsl bool) ([]byte, error)
}

func NewHttp added in v1.4.0

func NewHttp() Http

type HttpClientFactory added in v1.4.0

type HttpClientFactory interface {
	NewClient(sslDisabled bool) *http.Client
}

func NewHttpClientFactory added in v1.4.0

func NewHttpClientFactory() HttpClientFactory

type HttpWrapper added in v1.3.1

type HttpWrapper struct {
	HttpClientFactory HttpClientFactory
}

func (*HttpWrapper) Get added in v1.3.1

func (self *HttpWrapper) Get(url string, accessToken string, sslDisabled bool) ([]byte, error)

type MysqlClientRunner

type MysqlClientRunner struct {
	ExecWrapper Exec
}

func (*MysqlClientRunner) MakeMysqlCommand

func (self *MysqlClientRunner) MakeMysqlCommand(hostname string, port int, dbName string, username string, password string) *exec.Cmd

func (*MysqlClientRunner) RunMysql

func (self *MysqlClientRunner) RunMysql(hostname string, port int, dbName string, username string, password string, mysqlArgs ...string) error

func (*MysqlClientRunner) RunMysqlDump added in v1.3.0

func (self *MysqlClientRunner) RunMysqlDump(hostname string, port int, dbName string, username string, password string, mysqlDumpArgs ...string) error

type MysqlPlugin

type MysqlPlugin struct {
	In          io.Reader
	Out         io.Writer
	Err         io.Writer
	CfService   CfService
	MysqlRunner MysqlRunner
	PortFinder  PortFinder
	// contains filtered or unexported fields
}

func NewPlugin

func NewPlugin() *MysqlPlugin

func (*MysqlPlugin) GetExitCode

func (self *MysqlPlugin) GetExitCode() int

func (*MysqlPlugin) GetMetadata

func (self *MysqlPlugin) GetMetadata() plugin.PluginMetadata

func (*MysqlPlugin) Run

func (self *MysqlPlugin) Run(cliConnection plugin.CliConnection, args []string)

type MysqlRunner

type MysqlRunner interface {
	RunMysql(hostname string, port int, dbName string, username string, password string, args ...string) error
	RunMysqlDump(hostname string, port int, dbName string, username string, password string, args ...string) error
}

func NewMysqlRunner

func NewMysqlRunner() MysqlRunner

type MysqlService

type MysqlService struct {
	Name     string
	AppName  string
	Hostname string
	Port     string
	DbName   string
	Username string
	Password string
}

type Net

type Net interface {
	Dial(network, address string) (net.Conn, error)
	Close(conn net.Conn) error
}

type NetWrapper

type NetWrapper struct{}

func (*NetWrapper) Close

func (self *NetWrapper) Close(conn net.Conn) error

func (*NetWrapper) Dial

func (self *NetWrapper) Dial(network, address string) (net.Conn, error)

type PortFinder

type PortFinder interface {
	GetPort() int
}

type PortWaiter

type PortWaiter interface {
	WaitUntilOpen(localPort int)
}

func NewPortWaiter

func NewPortWaiter() PortWaiter

type SshRunner

type SshRunner interface {
	OpenSshTunnel(cliConnection plugin.CliConnection, toService MysqlService, throughApp string, localPort int)
}

type StartedAppsResult added in v1.3.1

type StartedAppsResult struct {
	Apps []plugin_models.GetAppsModel
	Err  error
}

type TcpPortWaiter

type TcpPortWaiter struct {
	NetWrapper Net
}

func (*TcpPortWaiter) WaitUntilOpen

func (self *TcpPortWaiter) WaitUntilOpen(localPort int)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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