client

package
v0.14.4 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientHandler

type ClientHandler interface {
	GetName() string
	HasUid(uid string) bool
	GetUids() map[string]string
	GetUser() *model.User
	GetVersion() int32
	SendMsg(msg *cot.CotMessage) error
	SendCot(msg *cotproto.TakMessage) error
	GetLastSeen() *time.Time
}

type ConnClientHandler

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

func NewConnClientHandler

func NewConnClientHandler(name string, conn net.Conn, config *HandlerConfig) *ConnClientHandler

func (*ConnClientHandler) ForAllUid

func (h *ConnClientHandler) ForAllUid(fn func(string, string) bool)

func (*ConnClientHandler) GetLastSeen

func (h *ConnClientHandler) GetLastSeen() *time.Time

func (*ConnClientHandler) GetName

func (h *ConnClientHandler) GetName() string

func (*ConnClientHandler) GetUid

func (h *ConnClientHandler) GetUid(callsign string) string

func (*ConnClientHandler) GetUids

func (h *ConnClientHandler) GetUids() map[string]string

func (*ConnClientHandler) GetUser

func (h *ConnClientHandler) GetUser() *model.User

func (*ConnClientHandler) GetVersion

func (h *ConnClientHandler) GetVersion() int32

func (*ConnClientHandler) HasUid added in v0.14.0

func (h *ConnClientHandler) HasUid(uid string) bool

func (*ConnClientHandler) IsActive

func (h *ConnClientHandler) IsActive() bool

func (*ConnClientHandler) SendCot added in v0.14.0

func (h *ConnClientHandler) SendCot(msg *cotproto.TakMessage) error

func (*ConnClientHandler) SendMsg

func (h *ConnClientHandler) SendMsg(msg *cot.CotMessage) error

func (*ConnClientHandler) SetVersion

func (h *ConnClientHandler) SetVersion(n int32)

func (*ConnClientHandler) Start

func (h *ConnClientHandler) Start()

type HandlerConfig

type HandlerConfig struct {
	User         *model.User
	Serial       string
	Uid          string
	IsClient     bool
	MessageCb    func(msg *cot.CotMessage)
	RemoveCb     func(ch ClientHandler)
	NewContactCb func(uid, callsign string)
	Logger       *zap.SugaredLogger
}

Jump to

Keyboard shortcuts

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