postgres

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const PostgresDefaultPort = "5432"

Variables

This section is empty.

Functions

func GetServerAddress

func GetServerAddress(creds Credentials) string

func NewCmdWrapper

func NewCmdWrapper(cmd *exec.Cmd) *cmdWrapper

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

type MockRuntime struct {
	mock.Mock
}

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

type MockRuntime_DumpAll_Call struct {
	*mock.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 (*MockRuntime_DumpAll_Call) Run

func (*MockRuntime_DumpAll_Call) RunAndReturn

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

type MockRuntime_Restore_Call struct {
	*mock.Call
}

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 (*MockRuntime_Restore_Call) Run added in v0.0.2

func (*MockRuntime_Restore_Call) RunAndReturn added in v0.0.2

type RestoreOptions added in v0.0.2

type RestoreOptions struct{}

type Runtime

Represents a place (i.e. local or remote) where commands can run.

Jump to

Keyboard shortcuts

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