platforms

package
v0.1.25 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: GPL-3.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

View Source
const SPREAD_SPECIFIC string = "specific"
View Source
const SPREAD_UNIFORM string = "uniform"

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	Platform IPlatform
	General  *General
	Type     string

	Lock sync.RWMutex
	// contains filtered or unexported fields
}

func (*Container) Delete

func (c *Container) Delete() error

func (*Container) Exec

func (c *Container) Exec(command []string) (types.ExecResult, error)

func (*Container) GetDefinition

func (c *Container) GetDefinition() contracts.IDefinition

func (*Container) GetDomain

func (c *Container) GetDomain(network string) string

func (*Container) GetGeneratedName

func (c *Container) GetGeneratedName() string

func (*Container) GetGroup

func (c *Container) GetGroup() string

func (*Container) GetGroupIdentifier

func (c *Container) GetGroupIdentifier() string

func (*Container) GetHeadlessDomain

func (c *Container) GetHeadlessDomain(network string) string

func (*Container) GetId

func (c *Container) GetId() string

func (*Container) GetLabels

func (c *Container) GetLabels() map[string]string

func (*Container) GetName

func (c *Container) GetName() string

func (*Container) GetNode

func (c *Container) GetNode() uint64

func (*Container) GetNodeName

func (c *Container) GetNodeName() string

func (*Container) GetRuntime

func (c *Container) GetRuntime() *types.Runtime

func (*Container) GetState added in v0.1.24

func (c *Container) GetState() (state.State, error)

func (*Container) GetStatus

func (c *Container) GetStatus() *status.Status

func (*Container) HasDependencyOn

func (c *Container) HasDependencyOn(kind string, group string, name string) bool

func (*Container) HasOwner

func (c *Container) HasOwner() bool

func (*Container) IsGhost

func (c *Container) IsGhost() bool

func (*Container) Kill

func (c *Container) Kill(signal string) error

func (*Container) Logs

func (c *Container) Logs(follow bool) (io.ReadCloser, error)

func (*Container) PostRun

func (c *Container) PostRun(config *configuration.Configuration, dnsCache *dns.Records) error

func (*Container) PreRun added in v0.1.24

func (c *Container) PreRun(config *configuration.Configuration, client *client.Http, user *authentication.User) error

func (*Container) RemoveDns

func (c *Container) RemoveDns(cache *dns.Records, networkId string) error

func (*Container) Rename

func (c *Container) Rename(newName string) error

func (*Container) Restart

func (c *Container) Restart() error

func (*Container) Run

func (c *Container) Run() error

func (*Container) SetGhost

func (c *Container) SetGhost(ghost bool)

func (*Container) Start

func (c *Container) Start() error

func (*Container) Stop

func (c *Container) Stop(signal string) error

func (*Container) SyncNetwork added in v0.1.24

func (c *Container) SyncNetwork() error

func (*Container) ToJson

func (c *Container) ToJson() ([]byte, error)

func (*Container) UpdateDns

func (c *Container) UpdateDns(cache *dns.Records) error

type General

type General struct {
	Labels  map[string]string
	Runtime *types.Runtime
	Status  *status.Status
}

type IContainer

type IContainer interface {
	Run() error
	PreRun(config *configuration.Configuration, client *client.Http, user *authentication.User) error
	PostRun(config *configuration.Configuration, dnsCache *dns.Records) error

	UpdateDns(dnsCache *dns.Records) error
	RemoveDns(dnsCache *dns.Records, networkId string) error
	SyncNetwork() error

	HasDependencyOn(string, string, string) bool
	HasOwner() bool

	GetState() (state.State, error)
	GetRuntime() *types.Runtime
	GetStatus() *status.Status
	GetNode() uint64
	GetNodeName() string
	GetId() string
	GetDefinition() contracts.IDefinition
	GetLabels() map[string]string
	GetGeneratedName() string
	GetName() string
	GetGroup() string
	GetGroupIdentifier() string
	GetDomain(network string) string
	GetHeadlessDomain(network string) string

	IsGhost() bool
	SetGhost(bool)

	Start() error
	Stop(signal string) error
	Kill(signal string) error
	Restart() error
	Delete() error
	Rename(newName string) error
	Exec(command []string) (types.ExecResult, error)
	Logs(bool) (io.ReadCloser, error)

	ToJson() ([]byte, error)
}

func New

func New(platform string, name string, config *configuration.Configuration, definition contracts.IDefinition) (IContainer, error)

func NewGhost

func NewGhost(state map[string]interface{}) (IContainer, error)

type IPlatform

type IPlatform interface {
	Run() error
	PreRun(config *configuration.Configuration, client *client.Http, user *authentication.User, runtime *types.Runtime) error
	PostRun(config *configuration.Configuration, dnsCache *dns.Records) error

	UpdateDns(dnsCache *dns.Records) error
	RemoveDns(dnsCache *dns.Records, networkId string) error
	SyncNetwork() error

	GetState() (state.State, error)
	GetId() string
	GetDefinition() contracts.IDefinition
	GetGeneratedName() string
	GetName() string
	GetGroup() string
	GetGroupIdentifier() string
	GetDomain(networkName string) string
	GetHeadlessDomain(networkName string) string

	Start() error
	Stop(signal string) error
	Kill(signal string) error
	Restart() error
	Delete() error
	Rename(newName string) error
	Exec(command []string) (types.ExecResult, error)
	Logs(bool) (io.ReadCloser, error)

	ToJson() ([]byte, error)
}

type Registry added in v0.1.24

type Registry interface {
	AddOrUpdate(group string, name string, containerAddr IContainer)
	Sync(group string, name string) error

	Remove(prefix string, group string, name string) error
	FindLocal(group string, name string) IContainer
	Find(prefix string, group string, name string) IContainer

	FindGroup(prefix string, group string) []IContainer
	Name(client *client.Http, group string, name string) (string, []uint64)
	NameReplica(group string, name string, index uint64) string
	BackOff(group string, name string) error
	BackOffReset(group string, name string)
	GetIndexes(group string, name string) []uint64
}

Directories

Path Synopsis
engines

Jump to

Keyboard shortcuts

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