libmongoose

package module
v0.0.0-...-f624bfa Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2021 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func Connect

func Connect(addr, name, version string) (*Client, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) Receive

func (c *Client) Receive() (*Task, error)

func (*Client) Send

func (c *Client) Send(d Data) error

type Data

type Data []map[string]string

func (*Data) DecodeMsg

func (z *Data) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (Data) EncodeMsg

func (z Data) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (Data) MarshalMsg

func (z Data) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (Data) Msgsize

func (z Data) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Data) UnmarshalMsg

func (z *Data) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ErrorLog

type ErrorLog struct {
	Level     string `json:"level"`
	Timestamp string `json:"timestamp"`
	Source    string `json:"source"`
	Plugin    string `json:"plugin"`
	Msg       string `json:"msg"`
}

ErrorLog describes the log format sent to the server

type LoggerWriter

type LoggerWriter struct {
	Client *Client
}

LoggerWriter is an empty structure of log hook

func (*LoggerWriter) Write

func (w *LoggerWriter) Write(p []byte) (n int, err error)

Implement the corresponding method of the interface

type RegistRequest

type RegistRequest struct {
	Pid     uint32 `msg:"pid"`
	Name    string `msg:"name"`
	Version string `msg:"version"`
}

RegistRequest is used to describe the data structure of the plugin registration request

func (*RegistRequest) DecodeMsg

func (z *RegistRequest) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (RegistRequest) EncodeMsg

func (z RegistRequest) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (RegistRequest) MarshalMsg

func (z RegistRequest) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (RegistRequest) Msgsize

func (z RegistRequest) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*RegistRequest) UnmarshalMsg

func (z *RegistRequest) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Task

type Task struct {
	ID      uint32 `msg:"id"`
	Content string `msg:"content"`
	Token   string `msg:"token"`
}

func (*Task) DecodeMsg

func (z *Task) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (Task) EncodeMsg

func (z Task) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (Task) MarshalMsg

func (z Task) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (Task) Msgsize

func (z Task) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Task) UnmarshalMsg

func (z *Task) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

Jump to

Keyboard shortcuts

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