mock

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientGetM

func ClientGetM[T any](c *Client, key string) (T, bool)

func GraphMsgGetM

func GraphMsgGetM[T any](msg graph.IMsg, key string) (T, bool)

Types

type Client

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

func MsgGetClient

func MsgGetClient(msg graph.IMsg) *Client

func NewClient

func NewClient(opt Option) (*Client, *util.Err)

func (*Client) BindNetMsg

func (c *Client) BindNetMsg(node string, msg util.IMsg, receiver MsgToStrAny)

func (*Client) BindPointMsg

func (c *Client) BindPointMsg(node, inPoint string, fn graph.MsgToErr)

func (*Client) Dialer

func (c *Client) Dialer() kiwi.IDialer

func (*Client) GetM

func (c *Client) GetM(key string) (any, bool)

func (*Client) Graph

func (c *Client) Graph() graph.IGraph

func (*Client) Id

func (c *Client) Id() string

func (*Client) Push

func (c *Client) Push(fn util.FnAnySlc, params ...any)

func (*Client) Receive

func (c *Client) Receive(agent kiwi.IAgent, bytes []byte)

func (*Client) SetM

func (c *Client) SetM(key string, data any)

type Decoder

type Decoder func(kiwi.IAgent, []byte) (svc kiwi.TSvc, mtd kiwi.TCode, msg util.IMsg, err *util.Err)

type MsgToStrAny

type MsgToStrAny func(client *Client, msg util.IMsg) (point string, data any)

type Option

type Option struct {
	Id      string
	Name    string
	Ip      string
	Port    int
	Mermaid []byte
	Decoder Decoder
	Head    util.M
	HeadLen uint32
}

type Receiver

type Receiver struct {
	Node string
	Fn   MsgToStrAny
}

Jump to

Keyboard shortcuts

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