message

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(c net.Conn, sc ...int) (v any, err error)

func ReadL

func ReadL(c net.Conn, ls ...log.L) (v any, ne bool)

func ReadRaw

func ReadRaw(c net.Conn, sc ...int) (byte, []byte, error)

func Write

func Write(c net.Conn, msg any, sc ...int) error

func WriteL

func WriteL(c net.Conn, msg any, ls ...log.L) bool

Types

type Close

type Close struct {
	Reason string `json:"reason,omitempty"`
}

type CloseTaskReq

type CloseTaskReq struct {
	Tid string `json:"tid,omitempty"`
}

type CloseTaskResp

type CloseTaskResp struct {
}

type ConnectTaskReq

type ConnectTaskReq struct {
	Wid string `json:"wid,omitempty"`
	Tid string `json:"tid,omitempty"`

	Task
}

type ConnectTaskResp

type ConnectTaskResp struct {
	Sid string `json:"sid,omitempty"`

	Task
	Error
}

type CreateTaskReq

type CreateTaskReq struct {
	Tid string `json:"tid,omitempty"`
	Sid string `json:"sid,omitempty"`

	Task
}

type CreateTaskResp

type CreateTaskResp struct {
	Sid string `json:"sid,omitempty"`

	Error
}

type Data

type Data struct {
}

type Error

type Error struct {
	Error string `json:"error,omitempty"`
}

func NewError

func NewError(v string, a ...any) Error

func (Error) GetError

func (err Error) GetError() string

type LoginReq

type LoginReq struct {
	Ver string `json:"ver,omitempty"`
	Key string `json:"key,omitempty"`

	GO       string `json:"go,omitempty"`
	OS       string `json:"os,omitempty"`
	ARCH     string `json:"arch,omitempty"`
	Hostname string `json:"hostname,omitempty"`
}

type LoginResp

type LoginResp struct {
	Ver string `json:"ver,omitempty"`

	Error
}

type OK

type OK struct {
}

type Task

type Task struct {
	Id     uint   `json:"id,omitempty"`
	Name   string `json:"name,omitempty"`
	Addr   string `json:"addr,omitempty"`
	Secret string `json:"secret,omitempty"`
}

func NewTask

func NewTask(id uint, name, addr string) Task

func NewTaskSecret

func NewTaskSecret(secret string) Task

type WorkReq

type WorkReq struct {
}

type WorkResp

type WorkResp struct {
	Wid string `json:"wid,omitempty"`

	Error
}

Jump to

Keyboard shortcuts

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