platform

package
v0.0.0-...-0490640 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoPlatformEnvironment = errors.New("Platform environment not correctly configured." +
	" Both A2_SVC_NAME and A2_SVC_PATH must be set in the environment")

Functions

func PGURIFromEnvironment

func PGURIFromEnvironment(database string) (string, error)

Types

type Config

type Config struct {
	*platform.Config

	SvcDBUser string
}

func ConfigFromEnvironment

func ConfigFromEnvironment() (*Config, error)

func (*Config) ExternalPGRootCertPath

func (c *Config) ExternalPGRootCertPath() string

func (*Config) GetPGConnInfoForSuperuserWithRole

func (c *Config) GetPGConnInfoForSuperuserWithRole(role string) (*PGConnInfo, error)

func (*Config) GetPGConnInfoURI

func (c *Config) GetPGConnInfoURI(user string, opts ...ConnInfoOpts) (*PGConnInfo, error)

func (*Config) GetPGURI

func (c *Config) GetPGURI(dbname string) (string, error)

func (*Config) GetPGURIForUser

func (c *Config) GetPGURIForUser(dbname string, user string) (string, error)

func (*Config) IsExternalPG

func (c *Config) IsExternalPG() bool

func (*Config) LoadTemplates

func (c *Config) LoadTemplates(funcs template.FuncMap) (*template.Template, error)

func (*Config) PGServiceUser

func (c *Config) PGServiceUser() (string, error)

func (*Config) PGSuperUser

func (c *Config) PGSuperUser() (string, error)

func (*Config) TemplatesPath

func (c *Config) TemplatesPath() string

type ConnInfoOpts

type ConnInfoOpts func(c *connInfoConfig)

func WithPGRole

func WithPGRole(role string) ConnInfoOpts

type PGConnInfo

type PGConnInfo struct {
	// contains filtered or unexported fields
}

func (*PGConnInfo) ConnURI

func (c *PGConnInfo) ConnURI(dbname string) string

func (*PGConnInfo) PsqlCmdOptions

func (c *PGConnInfo) PsqlCmdOptions() []command.Opt

func (*PGConnInfo) String

func (c *PGConnInfo) String() string

Directories

Path Synopsis
Package command is a wrapper for os/exec that provides a mock-able interface to make testing easier.
Package command is a wrapper for os/exec that provides a mock-able interface to make testing easier.
Package platform encapsulates platform-specific behavior.
Package platform encapsulates platform-specific behavior.

Jump to

Keyboard shortcuts

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