control

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteLine

func WriteLine(cc *ConnCarrier, line string, msgType int)

Types

type ConnCarrier

type ConnCarrier struct {
	Conn          *websocket.Conn
	Cf            config.CatalogConf
	File          string
	Tail          *tail.Tail
	StartTime     int64
	LastHeartTime int64
	Peer          string
	Add           bool

	Running bool
	// contains filtered or unexported fields
}

func NewConnCarrier

func NewConnCarrier(cm *ConnManager, conn *websocket.Conn, cf config.CatalogConf, file string) ConnCarrier

func (*ConnCarrier) Close

func (cc *ConnCarrier) Close()

func (*ConnCarrier) Handler

func (cc *ConnCarrier) Handler()

func (*ConnCarrier) Id

func (cc *ConnCarrier) Id() uint64

func (*ConnCarrier) String

func (cc *ConnCarrier) String() string

type ConnManager

type ConnManager struct {
	// contains filtered or unexported fields
}

func NewConnManager

func NewConnManager() *ConnManager

func (*ConnManager) AddConnCarrier

func (cc *ConnManager) AddConnCarrier(carrier *ConnCarrier)

func (*ConnManager) CheckConnMaxTime

func (cc *ConnManager) CheckConnMaxTime()

func (*ConnManager) CheckHeartTimeout

func (cc *ConnManager) CheckHeartTimeout()

func (*ConnManager) GenerateCarrierId

func (cc *ConnManager) GenerateCarrierId() uint64

func (*ConnManager) ProcessNewConn

func (cc *ConnManager) ProcessNewConn()

func (*ConnManager) Run

func (cc *ConnManager) Run()

type TailReqProtocol

type TailReqProtocol struct {
	Type    Type `json:"type"`
	UiWidth int  `json:"ui_width"`
}

func (*TailReqProtocol) LineNum

func (t *TailReqProtocol) LineNum() int

type TailRespProtocol

type TailRespProtocol struct {
	Type Type   `json:"type"`
	Msg  string `json:"msg"`
}

type Type

type Type int8
const (
	Read Type = iota
	Write
	Heart
	Close
)

Jump to

Keyboard shortcuts

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