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 NetWrapper
- type OsWrapper
- type PluginConf
- type PortFinder
- type PortWaiter
- type PsqlPlugin
- type PsqlRunner
- type PsqlService
- type RandWrapper
- type ServiceKeyRequest
- type SshRunner
- type StartedAppsResult
Constants ¶
View Source
const ServiceKeyName = "cf-psql"
View Source
const SleepTime = 100
Variables ¶
This section is empty.
Functions ¶
func NewApiClient ¶
func NewApiClient(httpClient HttpWrapper) *apiClient
func NewCfService ¶
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 ¶
type BindingResult struct { Bindings []pluginModels.ServiceBinding Err error }
type CfService ¶
type CfService interface { GetStartedApps(cliConnection plugin.CliConnection) ([]sdkModels.GetAppsModel, error) OpenSshTunnel(cliConnection plugin.CliConnection, toService PsqlService, apps []sdkModels.GetAppsModel, localPort int) GetService(connection plugin.CliConnection, name string) (PsqlService, error) }
type DefaultLocaleReader ¶
type DefaultLocaleReader struct{}
func (*DefaultLocaleReader) Locale ¶
func (self *DefaultLocaleReader) Locale() string
type ExecWrapper ¶
func NewExecWrapper ¶
func NewExecWrapper() ExecWrapper
type HttpClientFactory ¶
func NewHttpClientFactory ¶
func NewHttpClientFactory() HttpClientFactory
type HttpWrapper ¶
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 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 PsqlRunner PsqlRunner 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 PsqlPlugin ¶
type PsqlPlugin struct { In io.Reader Out io.Writer Err io.Writer CfService CfService PsqlRunner PsqlRunner PortFinder PortFinder // contains filtered or unexported fields }
func NewPsqlPlugin ¶
func NewPsqlPlugin(conf PluginConf) *PsqlPlugin
func (*PsqlPlugin) FormatUsage ¶
func (self *PsqlPlugin) FormatUsage() string
func (*PsqlPlugin) GetExitCode ¶
func (self *PsqlPlugin) GetExitCode() int
func (*PsqlPlugin) GetMetadata ¶
func (self *PsqlPlugin) GetMetadata() plugin.PluginMetadata
func (*PsqlPlugin) Run ¶
func (self *PsqlPlugin) Run(cliConnection plugin.CliConnection, args []string)
type PsqlRunner ¶
type PsqlRunner interface {
RunPsql(hostname string, port int, dbName string, username string, password string, args ...string) error
}
func NewPsqlRunner ¶
func NewPsqlRunner(execWrapper ExecWrapper) PsqlRunner
type PsqlService ¶
type RandWrapper ¶
func NewRandWrapper ¶
func NewRandWrapper() RandWrapper
type ServiceKeyRequest ¶
type SshRunner ¶
type SshRunner interface {
OpenSshTunnel(cliConnection plugin.CliConnection, toService PsqlService, throughApp string, localPort int)
}
func NewSshRunner ¶
func NewSshRunner() SshRunner
type StartedAppsResult ¶
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.