services

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2016 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Byte     = 1
	Kilobyte = 1024 * Byte
	Megabyte = 1024 * Kilobyte
)

Variables

This section is empty.

Functions

func CloseSession

func CloseSession(s *Session) error

func CloseSessionAfter

func CloseSessionAfter(s *Session, d time.Duration)

func ConnectNetwork

func ConnectNetwork(containerId, networkId string) error

func CreateAttachConnection

func CreateAttachConnection(id string, ctx context.Context) (*types.HijackedResponse, error)

func CreateNetwork

func CreateNetwork(name string) error

func CreateWSServer

func CreateWSServer() *socketio.Server

func DeleteContainer

func DeleteContainer(id string) error

func DeleteInstance

func DeleteInstance(session *Session, instance *Instance) error

func DeleteNetwork

func DeleteNetwork(id string) error

func DisconnectNetwork

func DisconnectNetwork(containerId, networkId string) error

func GetContainerInfo

func GetContainerInfo(id string) (types.ContainerJSON, error)

func GetContainerStats

func GetContainerStats(id string) (io.ReadCloser, error)

func GetDaemonInfo

func GetDaemonInfo(i *Instance) (types.Info, error)

func GetGoogleRecaptchaSiteKey

func GetGoogleRecaptchaSiteKey() string

func GetGoogleRecaptchaSiteSecret

func GetGoogleRecaptchaSiteSecret() string

func GetUsedPorts

func GetUsedPorts(i *Instance) ([]uint16, error)

func IsHuman

func IsHuman(req *http.Request) bool

func LoadSessionsFromDisk

func LoadSessionsFromDisk() error

func ResizeConnection

func ResizeConnection(name string, cols, rows uint) error

func SetInstanceSwarmPorts

func SetInstanceSwarmPorts(i *Instance) error

Types

type Client

type Client struct {
	Id string

	ViewPort ViewPort
	// contains filtered or unexported fields
}

func NewClient

func NewClient(so socketio.Socket, session *Session) *Client

func (*Client) ResizeViewPort

func (c *Client) ResizeViewPort(cols, rows uint)

type Instance

type Instance struct {
	Name     string `json:"name"`
	Hostname string `json:"hostname"`
	IP       string `json:"ip"`

	IsManager *bool    `json:"is_manager"`
	Mem       string   `json:"mem"`
	Cpu       string   `json:"cpu"`
	Ports     []uint16 `json:"ports"`
	// contains filtered or unexported fields
}

func CreateInstance

func CreateInstance(session *Session, dindImage string) (*Instance, error)

func GetInstance

func GetInstance(session *Session, name string) *Instance

func NewInstance

func NewInstance(session *Session) (*Instance, error)

func (*Instance) Attach

func (i *Instance) Attach()

func (*Instance) IsConnected

func (i *Instance) IsConnected() bool

func (*Instance) ResizeTerminal

func (i *Instance) ResizeTerminal(cols, rows uint) error

func (*Instance) SetSession

func (i *Instance) SetSession(s *Session)

type Session

type Session struct {
	Id        string               `json:"id"`
	Instances map[string]*Instance `json:"instances"`

	CreatedAt time.Time `json:"created_at"`
	ExpiresAt time.Time `json:"expires_at"`
	// contains filtered or unexported fields
}

func GetSession

func GetSession(sessionId string) *Session

func NewSession

func NewSession() (*Session, error)

func (*Session) AddNewClient

func (s *Session) AddNewClient(c *Client)

func (*Session) GetSmallestViewPort

func (s *Session) GetSmallestViewPort() ViewPort

func (*Session) Lock

func (s *Session) Lock()

func (*Session) SchedulePeriodicTasks

func (s *Session) SchedulePeriodicTasks()

func (*Session) Unlock

func (s *Session) Unlock()

type ViewPort

type ViewPort struct {
	Rows uint
	Cols uint
}

Jump to

Keyboard shortcuts

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