Documentation
¶
Index ¶
- Constants
- func NewApiClient(httpClient HttpWrapper) *apiClient
- func NewCfService(apiClient ApiClient, runner SshRunner, waiter PortWaiter, ...) *cfService
- func NewRequestDumper(osWrapper OsWrapper, writer io.Writer) *conditionalRequestDumper
- type ApiClient
- type BindingResult
- type CfService
- type CliConfig
- type DefaultLocaleReader
- type ExecWrapper
- type HttpClientFactory
- type HttpWrapper
- type MysqlPlugin
- type MysqlRunner
- type MysqlService
- type NetWrapper
- type OsWrapper
- type PluginConf
- type PortFinder
- type PortWaiter
- type RandWrapper
- type ServiceKeyRequest
- type SshRunner
- type StartedAppsResult
Constants ¶
View Source
const ServiceKeyName = "cf-mysql"
View Source
const SleepTime = 100
Variables ¶
This section is empty.
Functions ¶
func NewApiClient ¶ added in v1.3.4
func NewApiClient(httpClient HttpWrapper) *apiClient
func NewCfService ¶ added in v1.3.4
func NewCfService(apiClient ApiClient, runner SshRunner, waiter PortWaiter, httpClient HttpWrapper, randWrapper RandWrapper, logWriter io.Writer) *cfService
func NewRequestDumper ¶
Types ¶
type ApiClient ¶
type ApiClient interface {
GetStartedApps(cliConnection plugin.CliConnection) ([]sdkModels.GetAppsModel, error)
GetService(cliConnection plugin.CliConnection, spaceGuid string, name string) (pluginModels.ServiceInstance, error)
GetServiceKey(cliConnection plugin.CliConnection, serviceInstanceGuid string, keyName string) (key pluginModels.ServiceKey, found bool, err error)
CreateServiceKey(cliConnection plugin.CliConnection, serviceInstanceGuid string, keyName string) (pluginModels.ServiceKey, 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 {
GetStartedApps(cliConnection plugin.CliConnection) ([]sdkModels.GetAppsModel, error)
OpenSshTunnel(cliConnection plugin.CliConnection, toService MysqlService, apps []sdkModels.GetAppsModel, localPort int)
GetService(connection plugin.CliConnection, name string) (MysqlService, error)
}
type DefaultLocaleReader ¶
type DefaultLocaleReader struct{}
func (*DefaultLocaleReader) Locale ¶
func (self *DefaultLocaleReader) Locale() string
type ExecWrapper ¶
func NewExecWrapper ¶
func NewExecWrapper() ExecWrapper
type HttpClientFactory ¶ added in v1.4.0
func NewHttpClientFactory ¶ added in v1.4.0
func NewHttpClientFactory() HttpClientFactory
type HttpWrapper ¶ added in v1.3.1
type HttpWrapper interface {
Get(endpoint string, accessToken string, skipSsl bool) ([]byte, error)
Post(url string, body io.Reader, accessToken string, sslDisabled bool) ([]byte, error)
}
func NewHttpWrapper ¶
func NewHttpWrapper(factory HttpClientFactory, requestDumper net.RequestDumperInterface) HttpWrapper
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 NewMysqlPlugin ¶
func NewMysqlPlugin(conf PluginConf) *MysqlPlugin
func (*MysqlPlugin) FormatUsage ¶
func (self *MysqlPlugin) FormatUsage() string
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(execWrapper ExecWrapper) MysqlRunner
type MysqlService ¶
type NetWrapper ¶
type NetWrapper interface {
Dial(network, address string) (net.Conn, error)
Close(conn net.Conn) error
}
func NewNetWrapper ¶
func NewNetWrapper() NetWrapper
type OsWrapper ¶
func NewOsWrapper ¶
func NewOsWrapper() OsWrapper
type PluginConf ¶
type PluginConf struct {
In io.Reader
Out io.Writer
Err io.Writer
CfService CfService
MysqlRunner MysqlRunner
PortFinder PortFinder
}
type PortFinder ¶
type PortFinder interface {
GetPort() int
}
func NewPortFinder ¶
func NewPortFinder() PortFinder
type PortWaiter ¶
type PortWaiter interface {
WaitUntilOpen(localPort int)
}
func NewPortWaiter ¶
func NewPortWaiter(netWrapper NetWrapper) PortWaiter
type RandWrapper ¶
func NewRandWrapper ¶
func NewRandWrapper() RandWrapper
type ServiceKeyRequest ¶
type SshRunner ¶
type SshRunner interface {
OpenSshTunnel(cliConnection plugin.CliConnection, toService MysqlService, throughApp string, localPort int)
}
func NewSshRunner ¶
func NewSshRunner() SshRunner
type StartedAppsResult ¶ added in v1.3.1
type StartedAppsResult struct {
Apps []plugin_models.GetAppsModel
Err error
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
Click to show internal directories.
Click to hide internal directories.