adapter

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const CPU_SHARES = 1000000000
View Source
const DEFAULT_EFS_PATH = "/var/efs/"
View Source
const DEFAULT_HTTP_PORT = uint32(80)
View Source
const DEFAULT_NGINX_CONFIG = `` /* 653-byte string literal not displayed */
View Source
const DEFAULT_SSL_PORT = uint32(443)
View Source
const DOCKER_API_VERSION = "1.40"
View Source
const ERROR_LOGS_OVERLAP_MARGIN = 1 * time.Second
View Source
const LOCAL_DRIVER = "local"
View Source
const MEGABYTE = 1024 * 1024
View Source
const NGINX_CONF = "nginx.conf"
View Source
const ORBS_BLOCKS_TARGET = "/usr/local/var/orbs"
View Source
const ORBS_CACHE_TARGET = "/opt/orbs/cache"
View Source
const ORBS_LOGS_TARGET = "/opt/orbs/logs"
View Source
const ORBS_STATUS_TARGET = "/opt/orbs/status"
View Source
const PROXY_CONTAINER_NAME = "http-api-reverse-proxy"
View Source
const REXRAY_EBS_DRIVER = "rexray/ebs"
View Source
const SERVICE_EXECUTABLE_PATH = "/opt/orbs/service"
View Source
const SHARED_PROXY_NETWORK = "http-proxy-overlay"
View Source
const SHARED_SERVICES_NETWORK = "services-overlay"
View Source
const SHARED_SIGNER_NETWORK = "signer-overlay"
View Source
const SSL_CERT = "ssl-cert"
View Source
const SSL_KEY = "ssl-key"
View Source
const VCHAINS_CONF = "vchains.conf"

Variables

This section is empty.

Functions

func GetNestedLogsMountPath added in v1.4.0

func GetNestedLogsMountPath(simpleName string) string

func GetNginxStatusMountPath added in v1.0.0

func GetNginxStatusMountPath(simpleName string) string

func GetSysctls added in v0.14.0

func GetSysctls() map[string]string

Types

type AppConfig

type AppConfig struct {
	KeyPair []byte
	Network []byte
	Config  []byte
}

type ContainerStatus

type ContainerStatus struct {
	Name   string
	NodeID string
	State  string
	Error  string

	Logs string

	CreatedAt time.Time
}

type DynamicManagementConfig added in v1.0.0

type DynamicManagementConfig struct {
	Url string
}

type Orchestrator

type Orchestrator interface {
	PullImage(ctx context.Context, imageName string) error

	RunVirtualChain(ctx context.Context, serviceConfig *ServiceConfig, appConfig *AppConfig) error
	RunReverseProxy(ctx context.Context, config *ReverseProxyConfig) error
	RunService(ctx context.Context, serviceConfig *ServiceConfig, appConfig *AppConfig) error

	RemoveService(ctx context.Context, containerName string) error

	GetOverlayNetwork(ctx context.Context, name string) (string, error)

	GetStatus(ctx context.Context, since time.Duration) ([]*ContainerStatus, error)

	io.Closer
}

func NewDockerSwarm

func NewDockerSwarm(options OrchestratorOptions, logger log.Logger) (Orchestrator, error)

type OrchestratorMock added in v1.0.0

type OrchestratorMock struct {
	mock.Mock
}

func (*OrchestratorMock) Close added in v1.0.0

func (a *OrchestratorMock) Close() error

func (*OrchestratorMock) GetOverlayNetwork added in v1.0.0

func (a *OrchestratorMock) GetOverlayNetwork(ctx context.Context, name string) (string, error)

func (*OrchestratorMock) GetStatus added in v1.0.0

func (a *OrchestratorMock) GetStatus(ctx context.Context, since time.Duration) (results []*ContainerStatus, err error)

func (*OrchestratorMock) PullImage added in v1.0.0

func (a *OrchestratorMock) PullImage(ctx context.Context, imageName string) error

func (*OrchestratorMock) RemoveService added in v1.0.0

func (a *OrchestratorMock) RemoveService(ctx context.Context, containerName string) error

func (*OrchestratorMock) RunReverseProxy added in v1.0.0

func (a *OrchestratorMock) RunReverseProxy(ctx context.Context, config *ReverseProxyConfig) error

func (*OrchestratorMock) RunService added in v1.0.0

func (a *OrchestratorMock) RunService(ctx context.Context, serviceConfig *ServiceConfig, appConfig *AppConfig) error

func (*OrchestratorMock) RunVirtualChain added in v1.0.0

func (a *OrchestratorMock) RunVirtualChain(ctx context.Context, serviceConfig *ServiceConfig, appConfig *AppConfig) error

type OrchestratorOptions

type OrchestratorOptions struct {
	StorageDriver          string            `json:"storage-driver"`
	StorageMountType       string            `json:"storage-mount-type"`
	StorageOptions         map[string]string `json:"storage-options"`
	MaxReloadTimedDelayStr string            `json:"max-reload-time-delay"`

	DynamicManagementConfig DynamicManagementConfig

	// Testing purposes
	HTTPPort uint32 `json:"http-port"`
	SSLPort  uint32 `json:"ssl-port"`
}

func (OrchestratorOptions) MaxReloadTimedDelay

func (s OrchestratorOptions) MaxReloadTimedDelay() time.Duration

func (OrchestratorOptions) MountType added in v1.0.0

func (s OrchestratorOptions) MountType() mount.Type

type ReverseProxyConfig added in v0.12.0

type ReverseProxyConfig struct {
	ContainerName string
	NodeAddress   string

	HTTPPort uint32
	SSLPort  uint32

	NginxConfig string

	Services []ReverseProxyConfigService

	SSLCertificate []byte
	SSLPrivateKey  []byte
}

type ReverseProxyConfigService added in v1.0.0

type ReverseProxyConfigService struct {
	Name        string
	ServiceName string
}

type SSLOptions added in v0.12.0

type SSLOptions struct {
	SSLCertificatePath string
	SSLPrivateKeyPath  string
}

type ServiceConfig

type ServiceConfig struct {
	// vchain only
	Id          uint32
	NodeAddress string
	Name        string

	// common
	ImageName      string
	ContainerName  string
	ExecutablePath string

	InternalPort int
	ExternalPort int

	AllowAccessToSigner     bool
	AllowAccessToServices   bool
	HTTPProxyNetworkEnabled bool

	LimitedMemory  int64
	LimitedCPU     float64
	ReservedMemory int64
	ReservedCPU    float64

	// logs service only
	LogsMountPointNames map[string]string // simple name -> namespaced name
}

Jump to

Keyboard shortcuts

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