Documentation
¶
Overview ¶
Package drivers implements common interfaces and utilities for Apoxy service drivers
Index ¶
- Constants
- func ForwardTCP(stopCh <-chan struct{}, cname string, localPort, remotePort int) error
- func WithLogsDir(logsDir string) func(*BackplaneSupervisorDriver)
- func WithTunnelProxyLogsDir(logsDir string) func(*TunnelProxySupervisorDriver)
- type APIServerDockerDriver
- func (d *APIServerDockerDriver) GetAddr(ctx context.Context) (string, error)
- func (db *APIServerDockerDriver) ImageRef(repo string) string
- func (db *APIServerDockerDriver) Init(ctx context.Context, opts ...Option) error
- func (db *APIServerDockerDriver) PullPolicy() string
- func (d *APIServerDockerDriver) Start(ctx context.Context, orgID uuid.UUID, serviceName string, opts ...Option) (string, error)
- func (d *APIServerDockerDriver) Stop(orgID uuid.UUID, serviceName string)
- type APIServerSupervisorDriver
- type BackplaneDockerDriver
- func (d *BackplaneDockerDriver) GetAddr(ctx context.Context) (string, error)
- func (db *BackplaneDockerDriver) ImageRef(repo string) string
- func (db *BackplaneDockerDriver) Init(ctx context.Context, opts ...Option) error
- func (db *BackplaneDockerDriver) PullPolicy() string
- func (d *BackplaneDockerDriver) Start(ctx context.Context, orgID uuid.UUID, proxyName string, opts ...Option) (string, error)
- func (d *BackplaneDockerDriver) Stop(orgID uuid.UUID, proxyName string)
- type BackplaneSupervisorDriver
- type Driver
- type DriverMode
- type Option
- type Options
- type ServiceType
- type TunnelProxyDockerDriver
- func (d *TunnelProxyDockerDriver) GetAddr(ctx context.Context) (string, error)
- func (db *TunnelProxyDockerDriver) ImageRef(repo string) string
- func (db *TunnelProxyDockerDriver) Init(ctx context.Context, opts ...Option) error
- func (db *TunnelProxyDockerDriver) PullPolicy() string
- func (d *TunnelProxyDockerDriver) Start(ctx context.Context, orgID uuid.UUID, proxyName string, opts ...Option) (string, error)
- func (d *TunnelProxyDockerDriver) Stop(orgID uuid.UUID, proxyName string)
- type TunnelProxySupervisorDriver
Constants ¶
const ( // APIServerStdoutLogFile is the name of the apiserver stdout log file APIServerStdoutLogFile = "apiserver.stdout.log" // APIServerStderrLogFile is the name of the apiserver stderr log file APIServerStderrLogFile = "apiserver.stderr.log" // APIServerProcessName is used to identify the apiserver process APIServerProcessName = "apiserver" )
const ( // DefaultLogsDir is the default directory for logs DefaultLogsDir = "/var/log/apoxy" // BackplaneStdoutLogFile is the name of the backplane stdout log file BackplaneStdoutLogFile = "backplane.stdout.log" // BackplaneStderrLogFile is the name of the backplane stderr log file BackplaneStderrLogFile = "backplane.stderr.log" // BackplaneProcessName is used to identify the backplane process BackplaneProcessName = "backplane" )
const ( // BackplaneService represents the backplane service. BackplaneService ServiceType = "backplane" // APIServerService represents the apiserver service. APIServerService ServiceType = "apiserver" // TunnelProxyService represents the tunnel proxy service. TunnelProxyService ServiceType = "tunnelproxy" // DockerMode represents the docker driver mode. DockerMode DriverMode = "docker" // SupervisorMode represents the supervisor driver mode. SupervisorMode DriverMode = "supervisor" )
const ( // DefaultTunnelProxyLogsDir is the default directory for logs DefaultTunnelProxyLogsDir = "/var/log/apoxy" // TunnelProxyStdoutLogFile is the name of the tunnelproxy stdout log file TunnelProxyStdoutLogFile = "tunnelproxy.stdout.log" // TunnelProxyStderrLogFile is the name of the tunnelproxy stderr log file TunnelProxyStderrLogFile = "tunnelproxy.stderr.log" // TunnelProxyProcessName is used to identify the tunnelproxy process TunnelProxyProcessName = "tunnelproxy" )
Variables ¶
This section is empty.
Functions ¶
func ForwardTCP ¶
ForwardTCP forwards localPort on host to a remotePort on a container cname.
func WithLogsDir ¶
func WithLogsDir(logsDir string) func(*BackplaneSupervisorDriver)
WithLogsDir sets the logs directory for the supervisor driver.
func WithTunnelProxyLogsDir ¶
func WithTunnelProxyLogsDir(logsDir string) func(*TunnelProxySupervisorDriver)
WithTunnelProxyLogsDir sets the logs directory for the supervisor driver.
Types ¶
type APIServerDockerDriver ¶
type APIServerDockerDriver struct {
// contains filtered or unexported fields
}
APIServerDockerDriver implements the Driver interface for Docker.
func NewAPIServerDockerDriver ¶
func NewAPIServerDockerDriver() *APIServerDockerDriver
NewAPIServerDockerDriver creates a new Docker driver for apiserver.
func (*APIServerDockerDriver) GetAddr ¶
func (d *APIServerDockerDriver) GetAddr(ctx context.Context) (string, error)
GetAddr implements the Driver interface.
func (*APIServerDockerDriver) PullPolicy ¶ added in v0.8.4
func (db *APIServerDockerDriver) PullPolicy() string
type APIServerSupervisorDriver ¶
type APIServerSupervisorDriver struct { // LogsDir is the directory where logs will be written LogsDir string // contains filtered or unexported fields }
APIServerSupervisorDriver implements the Driver interface for process supervision.
func NewAPIServerSupervisorDriver ¶
func NewAPIServerSupervisorDriver() *APIServerSupervisorDriver
NewAPIServerSupervisorDriver creates a new Supervisor driver with default configuration.
func (*APIServerSupervisorDriver) GetAddr ¶
func (d *APIServerSupervisorDriver) GetAddr(ctx context.Context) (string, error)
GetAddr implements the Driver interface.
type BackplaneDockerDriver ¶
type BackplaneDockerDriver struct {
// contains filtered or unexported fields
}
BackplaneDockerDriver implements the Driver interface for Docker.
func NewBackplaneDockerDriver ¶
func NewBackplaneDockerDriver() *BackplaneDockerDriver
NewBackplaneDockerDriver creates a new Docker driver for backplane.
func (*BackplaneDockerDriver) GetAddr ¶
func (d *BackplaneDockerDriver) GetAddr(ctx context.Context) (string, error)
GetAddr implements the Driver interface.
func (*BackplaneDockerDriver) PullPolicy ¶ added in v0.8.4
func (db *BackplaneDockerDriver) PullPolicy() string
type BackplaneSupervisorDriver ¶
type BackplaneSupervisorDriver struct { // LogsDir is the directory where logs will be written LogsDir string // contains filtered or unexported fields }
BackplaneSupervisorDriver implements the Driver interface for process supervision.
func NewBackplaneSupervisorDriver ¶
func NewBackplaneSupervisorDriver() *BackplaneSupervisorDriver
NewBackplaneSupervisorDriver creates a new Supervisor driver with default configuration.
func (*BackplaneSupervisorDriver) GetAddr ¶
func (d *BackplaneSupervisorDriver) GetAddr(ctx context.Context) (string, error)
GetAddr implements the Driver interface.
type Driver ¶
type Driver interface { // Start deploys and starts the service. Start(ctx context.Context, orgID uuid.UUID, serviceName string, opts ...Option) (string, error) // Stop stops the service. Stop(orgID uuid.UUID, serviceName string) // GetAddr returns the address of the service. GetAddr(ctx context.Context) (string, error) }
Driver is the interface that all service drivers must implement.
func GetAPIServerDriver ¶
func GetAPIServerDriver(driver DriverMode) (Driver, error)
GetAPIServerDriver returns an apiserver driver by name.
func GetBackplaneDriver ¶
func GetBackplaneDriver(driver DriverMode) (Driver, error)
GetBackplaneDriver returns a backplane driver by name.
func GetDriver ¶
func GetDriver(driverType DriverMode, serviceType ServiceType) (Driver, error)
GetDriver returns a driver by name for the specified service type.
func GetTunnelProxyDriver ¶
func GetTunnelProxyDriver(driver DriverMode) (Driver, error)
GetTunnelProxyDriver returns a tunnel proxy driver by name.
type DriverMode ¶
type DriverMode string
DriverMode represents the mode in which the driver is running.
type Option ¶
type Option func(*Options)
Option is a function that configures driver options.
func WithAPIServerAddr ¶
WithAPIServerAddr sets the apiserver address.
type ServiceType ¶
type ServiceType string
ServiceType represents the type of service being managed by a driver.
type TunnelProxyDockerDriver ¶
type TunnelProxyDockerDriver struct {
// contains filtered or unexported fields
}
TunnelProxyDockerDriver implements the Driver interface for Docker.
func NewTunnelProxyDockerDriver ¶
func NewTunnelProxyDockerDriver() *TunnelProxyDockerDriver
NewTunnelProxyDockerDriver creates a new Docker driver for tunnelproxy.
func (*TunnelProxyDockerDriver) GetAddr ¶
func (d *TunnelProxyDockerDriver) GetAddr(ctx context.Context) (string, error)
GetAddr implements the Driver interface.
func (*TunnelProxyDockerDriver) PullPolicy ¶ added in v0.8.4
func (db *TunnelProxyDockerDriver) PullPolicy() string
type TunnelProxySupervisorDriver ¶
type TunnelProxySupervisorDriver struct { // LogsDir is the directory where logs will be written LogsDir string // contains filtered or unexported fields }
TunnelProxySupervisorDriver implements the Driver interface for process supervision.
func NewTunnelProxySupervisorDriver ¶
func NewTunnelProxySupervisorDriver() *TunnelProxySupervisorDriver
NewTunnelProxySupervisorDriver creates a new Supervisor driver with default configuration.
func (*TunnelProxySupervisorDriver) GetAddr ¶
func (d *TunnelProxySupervisorDriver) GetAddr(ctx context.Context) (string, error)
GetAddr implements the Driver interface.