server

package
v0.0.0-...-4b711b1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartGRPC

func StartGRPC(ctx context.Context, cfg *Config) error

StartGRPC takes a context and server.Config, initializes a new Server and starts listening on the configured address

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

func (c *Config) ListenAddress() string

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

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

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

type PGWConfig

type PGWConfig struct {
	Host          string `mapstructure:"host"`
	Port          uint64 `mapstructure:"port"`
	SuperuserName string `mapstructure:"superuser_name"`
}

PGWConfig defines the available configuration options for the postgres gateway

Jump to

Keyboard shortcuts

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