spy

package
v0.0.0-...-452647d Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2022 License: GPL-3.0 Imports: 19 Imported by: 0

README

间谍程序

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(app, version string)

func RegisterHandler

func RegisterHandler(tp silk.Type, handler Handler)

func RegisterXORM

func RegisterXORM(engine *xorm.Engine)

func ReplaceHandler

func ReplaceHandler(tp silk.Type, handler Handler)

Types

type Client

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

func Connect

func Connect(options Options) (*Client, error)

func (*Client) Ask

func (c *Client) Ask(p *silk.Package) (*silk.Package, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Open

func (c *Client) Open() error

func (*Client) Publish

func (c *Client) Publish(topic string, payload []byte) error

func (*Client) Send

func (c *Client) Send(p *silk.Package) error

func (*Client) Spawn

func (c *Client) Spawn() error

func (*Client) Subscribe

func (c *Client) Subscribe(topic string) error

func (*Client) Unsubscribe

func (c *Client) Unsubscribe(topic string) error

type Handler

type Handler func(c *Client, p *silk.Package)

type Handlers

type Handlers []Handler

type Options

type Options struct {
	Addr      string `yaml:"addr" json:"addr"`
	Once      bool   `yaml:"once,omitempty" json:"once,omitempty"`
	Heartbeat int    `yaml:"heartbeat,omitempty" json:"heartbeat,omitempty"`
}

Jump to

Keyboard shortcuts

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