Documentation ¶
Index ¶
- Constants
- func CleanBinary() error
- func DecompressBinary(force bool) error
- func ReleaseArch() string
- func ReleaseArchive() []byte
- func ReleaseSha256() string
- func ReleaseTarget() string
- func ReleaseVersion() string
- type GpgsqlRuntime
- func (g *GpgsqlRuntime) CheckConnection(ctx context.Context) error
- func (g *GpgsqlRuntime) DB(dbname string) (*sql.DB, error)
- func (g *GpgsqlRuntime) DSN(dbname string) string
- func (g *GpgsqlRuntime) Daemon(ctx context.Context, opts ...*PostgreSqlOptions) (kill func() error, e error)
- func (g *GpgsqlRuntime) DaemonArgs(opt *PostgreSqlOptions) (args []string, e error)
- func (g *GpgsqlRuntime) Data(data string) (e error)
- func (g *GpgsqlRuntime) GetPassword() string
- func (g *GpgsqlRuntime) GetUsername() string
- func (g *GpgsqlRuntime) Host(host net.IP) *GpgsqlRuntime
- func (g *GpgsqlRuntime) Initdb(ctx context.Context, opts ...*InitdbOptions) (e error)
- func (g *GpgsqlRuntime) IsEmptyData() (bool, error)
- func (g *GpgsqlRuntime) ListenAddr() string
- func (g *GpgsqlRuntime) Logger(logger io.Writer) *GpgsqlRuntime
- func (g *GpgsqlRuntime) Password(password string) *GpgsqlRuntime
- func (g *GpgsqlRuntime) PgCli(ctx context.Context, method pgCliMethod, opts ...*PgCliOptions) (e error)
- func (g *GpgsqlRuntime) Port(port uint16) *GpgsqlRuntime
- func (g *GpgsqlRuntime) Start(ctx context.Context, opts ...*PostgreSqlOptions) error
- func (g *GpgsqlRuntime) Stop(ctx context.Context) error
- func (g *GpgsqlRuntime) Username(username string) *GpgsqlRuntime
- type HookWriter
- type InitdbOptions
- type PgCliOptions
- type PostgreSqlOptions
Constants ¶
View Source
const ( CliInit pgCliMethod = iota CliStart CliStop CliRestart CliStatus CliReload CliPromote CliLogrotate CliKill )
View Source
const (
PostgresqlDataPerm os.FileMode = 0750
)
Variables ¶
This section is empty.
Functions ¶
func CleanBinary ¶
func CleanBinary() error
func DecompressBinary ¶
form https://github.com/fergusstrange/embedded-postgres/blob/master/decompression.go#L23
func ReleaseArch ¶
func ReleaseArch() string
func ReleaseArchive ¶
func ReleaseArchive() []byte
func ReleaseSha256 ¶
func ReleaseSha256() string
func ReleaseTarget ¶
func ReleaseTarget() string
func ReleaseVersion ¶
func ReleaseVersion() string
Types ¶
type GpgsqlRuntime ¶
type GpgsqlRuntime struct {
// contains filtered or unexported fields
}
func New ¶
func New(forceDecompressBinary ...bool) (*GpgsqlRuntime, error)
func (*GpgsqlRuntime) CheckConnection ¶
func (g *GpgsqlRuntime) CheckConnection(ctx context.Context) error
func (*GpgsqlRuntime) DSN ¶
func (g *GpgsqlRuntime) DSN(dbname string) string
func (*GpgsqlRuntime) Daemon ¶
func (g *GpgsqlRuntime) Daemon(ctx context.Context, opts ...*PostgreSqlOptions) (kill func() error, e error)
func (*GpgsqlRuntime) DaemonArgs ¶
func (g *GpgsqlRuntime) DaemonArgs(opt *PostgreSqlOptions) (args []string, e error)
func (*GpgsqlRuntime) Data ¶
func (g *GpgsqlRuntime) Data(data string) (e error)
func (*GpgsqlRuntime) GetPassword ¶
func (g *GpgsqlRuntime) GetPassword() string
func (*GpgsqlRuntime) GetUsername ¶
func (g *GpgsqlRuntime) GetUsername() string
func (*GpgsqlRuntime) Host ¶
func (g *GpgsqlRuntime) Host(host net.IP) *GpgsqlRuntime
func (*GpgsqlRuntime) Initdb ¶
func (g *GpgsqlRuntime) Initdb(ctx context.Context, opts ...*InitdbOptions) (e error)
func (*GpgsqlRuntime) IsEmptyData ¶
func (g *GpgsqlRuntime) IsEmptyData() (bool, error)
func (*GpgsqlRuntime) ListenAddr ¶
func (g *GpgsqlRuntime) ListenAddr() string
func (*GpgsqlRuntime) Logger ¶
func (g *GpgsqlRuntime) Logger(logger io.Writer) *GpgsqlRuntime
func (*GpgsqlRuntime) Password ¶
func (g *GpgsqlRuntime) Password(password string) *GpgsqlRuntime
func (*GpgsqlRuntime) PgCli ¶
func (g *GpgsqlRuntime) PgCli(ctx context.Context, method pgCliMethod, opts ...*PgCliOptions) (e error)
func (*GpgsqlRuntime) Port ¶
func (g *GpgsqlRuntime) Port(port uint16) *GpgsqlRuntime
func (*GpgsqlRuntime) Start ¶
func (g *GpgsqlRuntime) Start(ctx context.Context, opts ...*PostgreSqlOptions) error
func (*GpgsqlRuntime) Username ¶
func (g *GpgsqlRuntime) Username(username string) *GpgsqlRuntime
type HookWriter ¶
type HookWriter struct {
// contains filtered or unexported fields
}
func NewHookWriter ¶
func NewHookWriter(w io.Writer) *HookWriter
func (*HookWriter) Error ¶
func (w *HookWriter) Error() error
func (*HookWriter) Hook ¶
func (w *HookWriter) Hook(f func(p []byte))
type InitdbOptions ¶
type PgCliOptions ¶
type PgCliOptions struct { Silent bool // only print errors, no informational messages Timeout int // seconds to wait when using wait option Wait bool // wait until operation completes CoreFiles bool // allow postgres to produce core files (only on start or restart) Mode string // can be "smart", "fast", or "immediate" (only on stop or restart) Options []string // command line options to pass to postgres (PostgreSQL server executable) or initdb Args []string // command line arguments }
type PostgreSqlOptions ¶
type PostgreSqlOptions struct { Nbuffers uint64 // number of shared buffers DebugLevel uint // debugging level DMY bool // use European date input format (DMY) FsyncOff bool // turn fsync off EnableTcpConnections bool // enable TCP/IP connections UnixSocket string // path to Unix domain socket SSL bool // enable SSL connections MaxConnection uint // maximum number of connections WorkMem uint64 // memory for query execution Parma map[string]string // set run-time parameter Args []string // additional arguments Wait time.Duration // wait for server to start Timeout time.Duration // timeout for check connections }
Click to show internal directories.
Click to hide internal directories.