cfmysql

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2016 License: Apache-2.0 Imports: 16 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 {
	GetMysqlServices(cliConnection plugin.CliConnection) ([]MysqlService, error)
	GetStartedApps(cliConnection plugin.CliConnection) ([]GetAppsModel, error)
	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 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) error

type MysqlPlugin

type MysqlPlugin struct {
	In          io.Reader
	Out         io.Writer
	Err         io.Writer
	ApiClient   ApiClient
	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) 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 SdkApiClient

type SdkApiClient struct {
	SshRunner  SshRunner
	PortWaiter PortWaiter
}

func NewSdkApiClient

func NewSdkApiClient() *SdkApiClient

func (*SdkApiClient) GetMysqlServices

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

func (*SdkApiClient) GetServiceBindings

func (self *SdkApiClient) GetServiceBindings(cliConnection plugin.CliConnection) (*pluginResources.PaginatedServiceBindingResources, error)

func (*SdkApiClient) GetServiceInstances

func (self *SdkApiClient) GetServiceInstances(cliConnection plugin.CliConnection) (*resources.PaginatedServiceInstanceResources, error)

func (*SdkApiClient) GetStartedApps

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

func (*SdkApiClient) OpenSshTunnel

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

type SshRunner

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

type TcpPortWaiter

type TcpPortWaiter struct {
	NetWrapper Net
}

func (*TcpPortWaiter) WaitUntilOpen

func (self *TcpPortWaiter) WaitUntilOpen(localPort int)

Directories

Path Synopsis
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was 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