context

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2019 License: BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsoleSession

type ConsoleSession struct {
	Fd     *os.File
	Closer chan struct{}
	Closed chan struct{}
}

ConsoleSession is container of console session.

type LegscContext

type LegscContext struct {
	PidFileName     string
	SockFileName    string
	StatusFileName  string
	Server          string
	Proxy           string
	DeviceName      string
	Secret          string
	UseWss          bool
	Status          *model.Status
	PingInterval    time.Duration
	Interrupt       chan os.Signal
	Restart         chan interface{}
	SocketListener  net.Listener
	Connection      *websocket.Conn
	ConsoleSessions map[string]ConsoleSession
}

LegscContext is global variables for through all over application.

func NewLegscContext

func NewLegscContext(conf *config.Config) *LegscContext

NewLegscContext return LegscContext instance made by configs.

func (*LegscContext) SendMessage

func (ctx *LegscContext) SendMessage(msg message.Message)

SendMessage sends message to server. It is not good to have this method here. But there is no other place to write this.

func (*LegscContext) UpdateStatus

func (ctx *LegscContext) UpdateStatus() (err error)

UpdateStatus update legsc status file

Jump to

Keyboard shortcuts

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