Documentation ¶
Index ¶
- func StartGRPC(ctx context.Context, cfg *Config) error
- type Config
- type PGSidecarServer
- func (p *PGSidecarServer) AlterRole(ctx context.Context, req *api.AlterRoleReq) (*api.AlterRoleRes, error)
- func (p *PGSidecarServer) CreateDB(ctx context.Context, req *api.CreateDBReq) (*api.CreateDBRes, error)
- func (p *PGSidecarServer) CreateExtension(ctx context.Context, req *api.CreateExtensionReq) (*api.CreateExtensionRes, error)
- func (p *PGSidecarServer) DeploySqitch(ctx context.Context, req *api.DeploySqitchReq) (*api.DeploySqitchRes, error)
- func (p *PGSidecarServer) DropTables(ctx context.Context, req *api.DropTablesReq) (*api.DropTablesRes, error)
- func (p *PGSidecarServer) MigrateTables(ctx context.Context, req *api.MigrateTablesReq) (*api.MigrateTablesRes, error)
- func (p *PGSidecarServer) RenameDB(ctx context.Context, req *api.RenameDBReq) (*api.RenameDBRes, error)
- func (p *PGSidecarServer) SetPublicSchemaRole(ctx context.Context, req *api.SetPublicSchemaRoleReq) (*api.SetPublicSchemaRoleRes, error)
- func (p *PGSidecarServer) Start() error
- type PGSidecarServerOpt
- type PGWConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Host string `mapstructure:"host"` Port int `mapstructure:"port"` LogLevel string `mapstructure:"log_level"` //PGW PGWConfig `mapstructure:"pgw" toml:"pgw"` certs.TLSConfig `mapstructure:"tls"` }
Config defines the available configuration options for this service
func (*Config) ListenAddress ¶
ListenAddress returns the servers listen address from the Host and Port
type PGSidecarServer ¶
type PGSidecarServer struct {
// contains filtered or unexported fields
}
PGSidecarServer is the implementation of the pg-sidecar-server
func NewPGSidecarServer ¶
func NewPGSidecarServer(opts ...PGSidecarServerOpt) *PGSidecarServer
NewPGSidecarServer takes functional options and returns a pointer to a new PGSidecarServer
func (*PGSidecarServer) AlterRole ¶
func (p *PGSidecarServer) AlterRole(ctx context.Context, req *api.AlterRoleReq) (*api.AlterRoleRes, error)
AlterRole alters a role with request options
func (*PGSidecarServer) CreateDB ¶
func (p *PGSidecarServer) CreateDB(ctx context.Context, req *api.CreateDBReq) (*api.CreateDBRes, error)
CreateDB creates a database
func (*PGSidecarServer) CreateExtension ¶
func (p *PGSidecarServer) CreateExtension(ctx context.Context, req *api.CreateExtensionReq) (*api.CreateExtensionRes, error)
CreateExtension creates an extension for a given database
func (*PGSidecarServer) DeploySqitch ¶
func (p *PGSidecarServer) DeploySqitch(ctx context.Context, req *api.DeploySqitchReq) (*api.DeploySqitchRes, error)
DeploySqitch runs sqitch for a given database, user and schema directory
func (*PGSidecarServer) DropTables ¶
func (p *PGSidecarServer) DropTables(ctx context.Context, req *api.DropTablesReq) (*api.DropTablesRes, error)
DropTables removes tables if they exist
func (*PGSidecarServer) MigrateTables ¶
func (p *PGSidecarServer) MigrateTables(ctx context.Context, req *api.MigrateTablesReq) (*api.MigrateTablesRes, error)
MigrateTables migrates from one database to the other
func (*PGSidecarServer) RenameDB ¶
func (p *PGSidecarServer) RenameDB(ctx context.Context, req *api.RenameDBReq) (*api.RenameDBRes, error)
RenameDB renames a database
func (*PGSidecarServer) SetPublicSchemaRole ¶
func (p *PGSidecarServer) SetPublicSchemaRole(ctx context.Context, req *api.SetPublicSchemaRoleReq) (*api.SetPublicSchemaRoleRes, error)
SetPublicSchemaRole applies a role to public and sqitch schemas
func (*PGSidecarServer) Start ¶
func (p *PGSidecarServer) Start() error
Start initializes the PGSidecarServer
type PGSidecarServerOpt ¶
type PGSidecarServerOpt func(*PGSidecarServer)
PGSidecarServerOpt is a functional option for configuring the PGSidecarServer
func WithPGSidecarServerConfig ¶
func WithPGSidecarServerConfig(cfg *Config) PGSidecarServerOpt
WithPGSidecarServerConfig sets the PGSidecarServer config
func WithPGSidecarServerPlatformConfig ¶
func WithPGSidecarServerPlatformConfig(platformConfig *platform_config.Config) PGSidecarServerOpt
WithPGSidecarServerPlatformConfig sets the platform config used by the server