Documentation
¶
Index ¶
- Constants
- func GetServerAddress(creds Credentials) string
- func NewCmdWrapper(cmd *exec.Cmd) *cmdWrapper
- type CredentialVariable
- type CredentialVariables
- type Credentials
- type DumpAllOptions
- type EnvironmentCredentials
- type LocalRuntime
- type MockRuntime
- type MockRuntime_DumpAll_Call
- type MockRuntime_Expecter
- type MockRuntime_Restore_Call
- type RestoreOptions
- type Runtime
Constants ¶
const PostgresDefaultPort = "5432"
Variables ¶
This section is empty.
Functions ¶
func GetServerAddress ¶
func GetServerAddress(creds Credentials) string
func NewCmdWrapper ¶
Types ¶
type CredentialVariable ¶
type CredentialVariable string
const ( HostVarName CredentialVariable = "PGHOST" PortVarName CredentialVariable = "PGPORT" DatabaseVarName CredentialVariable = "PGDATABASE" UserVarName CredentialVariable = "PGUSER" RequireAuthVarName CredentialVariable = "PGREQUIREAUTH" SSLModeVarName CredentialVariable = "PGSSLMODE" SSLCertVarName CredentialVariable = "PGSSLCERT" SSLKeyVarName CredentialVariable = "PGSSLKEY" SSLRootCertVarName CredentialVariable = "PGSSLROOTCERT" )
type CredentialVariables ¶
type CredentialVariables map[CredentialVariable]string
func (CredentialVariables) SetDatabaseName ¶
func (cv CredentialVariables) SetDatabaseName(name string) CredentialVariables
func (CredentialVariables) ToEnvSlice ¶
func (cv CredentialVariables) ToEnvSlice() []string
type Credentials ¶
type Credentials interface {
GetVariables() CredentialVariables
GetUsername() string
GetHost() string
GetPort() string
}
type DumpAllOptions ¶
type DumpAllOptions struct {
CleanupTimeout helpers.MaxWaitTime
}
type EnvironmentCredentials ¶
type EnvironmentCredentials CredentialVariables
func (EnvironmentCredentials) GetHost ¶
func (ec EnvironmentCredentials) GetHost() string
func (EnvironmentCredentials) GetPort ¶
func (ec EnvironmentCredentials) GetPort() string
func (EnvironmentCredentials) GetUsername ¶
func (ec EnvironmentCredentials) GetUsername() string
func (EnvironmentCredentials) GetVariables ¶
func (ec EnvironmentCredentials) GetVariables() CredentialVariables
type LocalRuntime ¶
type LocalRuntime struct {
// contains filtered or unexported fields
}
func NewLocalRuntime ¶
func NewLocalRuntime() *LocalRuntime
func (*LocalRuntime) DumpAll ¶
func (lr *LocalRuntime) DumpAll(ctx *contexts.Context, credentials Credentials, outputFilePath string, opts DumpAllOptions) (err error)
func (*LocalRuntime) Restore ¶ added in v0.0.2
func (lr *LocalRuntime) Restore(ctx *contexts.Context, credentials Credentials, inputFilePath string, opts RestoreOptions) (err error)
type MockRuntime ¶
MockRuntime is an autogenerated mock type for the Runtime type
func NewMockRuntime ¶
func NewMockRuntime(t interface {
mock.TestingT
Cleanup(func())
}) *MockRuntime
NewMockRuntime creates a new instance of MockRuntime. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockRuntime) DumpAll ¶
func (_m *MockRuntime) DumpAll(_a0 *contexts.Context, _a1 Credentials, _a2 string, _a3 DumpAllOptions) error
DumpAll provides a mock function with given fields: _a0, _a1, _a2, _a3
func (*MockRuntime) EXPECT ¶
func (_m *MockRuntime) EXPECT() *MockRuntime_Expecter
func (*MockRuntime) Restore ¶ added in v0.0.2
func (_m *MockRuntime) Restore(_a0 *contexts.Context, _a1 Credentials, _a2 string, _a3 RestoreOptions) error
Restore provides a mock function with given fields: _a0, _a1, _a2, _a3
type MockRuntime_DumpAll_Call ¶
MockRuntime_DumpAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DumpAll'
func (*MockRuntime_DumpAll_Call) Return ¶
func (_c *MockRuntime_DumpAll_Call) Return(_a0 error) *MockRuntime_DumpAll_Call
func (*MockRuntime_DumpAll_Call) Run ¶
func (_c *MockRuntime_DumpAll_Call) Run(run func(_a0 *contexts.Context, _a1 Credentials, _a2 string, _a3 DumpAllOptions)) *MockRuntime_DumpAll_Call
func (*MockRuntime_DumpAll_Call) RunAndReturn ¶
func (_c *MockRuntime_DumpAll_Call) RunAndReturn(run func(*contexts.Context, Credentials, string, DumpAllOptions) error) *MockRuntime_DumpAll_Call
type MockRuntime_Expecter ¶
type MockRuntime_Expecter struct {
// contains filtered or unexported fields
}
func (*MockRuntime_Expecter) DumpAll ¶
func (_e *MockRuntime_Expecter) DumpAll(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *MockRuntime_DumpAll_Call
DumpAll is a helper method to define mock.On call
- _a0 *contexts.Context
- _a1 Credentials
- _a2 string
- _a3 DumpAllOptions
func (*MockRuntime_Expecter) Restore ¶ added in v0.0.2
func (_e *MockRuntime_Expecter) Restore(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *MockRuntime_Restore_Call
Restore is a helper method to define mock.On call
- _a0 *contexts.Context
- _a1 Credentials
- _a2 string
- _a3 RestoreOptions
type MockRuntime_Restore_Call ¶ added in v0.0.2
MockRuntime_Restore_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Restore'
func (*MockRuntime_Restore_Call) Return ¶ added in v0.0.2
func (_c *MockRuntime_Restore_Call) Return(_a0 error) *MockRuntime_Restore_Call
func (*MockRuntime_Restore_Call) Run ¶ added in v0.0.2
func (_c *MockRuntime_Restore_Call) Run(run func(_a0 *contexts.Context, _a1 Credentials, _a2 string, _a3 RestoreOptions)) *MockRuntime_Restore_Call
func (*MockRuntime_Restore_Call) RunAndReturn ¶ added in v0.0.2
func (_c *MockRuntime_Restore_Call) RunAndReturn(run func(*contexts.Context, Credentials, string, RestoreOptions) error) *MockRuntime_Restore_Call
type RestoreOptions ¶ added in v0.0.2
type RestoreOptions struct{}
type Runtime ¶
type Runtime interface {
DumpAll(*contexts.Context, Credentials, string, DumpAllOptions) error
Restore(*contexts.Context, Credentials, string, RestoreOptions) error
}
Represents a place (i.e. local or remote) where commands can run.