agentlink

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEMO1 = "agentlink.demo1"
	DEMO2 = "agentlink.demo2"
	DEMO3 = "agentlink.demo3"

	TestPing = "agentlink.test.ping"
	TestPong = "agentlink.test.pong"
	TestDone = "agentlink.test.done"
)

这些是在 AgentLink 上传输的属性

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentLinkConn

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

func (*AgentLinkConn) Close

func (inst *AgentLinkConn) Close() error

func (*AgentLinkConn) GetReader

func (inst *AgentLinkConn) GetReader() Reader

func (*AgentLinkConn) GetWriter

func (inst *AgentLinkConn) GetWriter() Writer

func (*AgentLinkConn) Init

func (inst *AgentLinkConn) Init(conn net.Conn, h Handler) error

func (*AgentLinkConn) RunLoop

func (inst *AgentLinkConn) RunLoop() error

type AgentLinkConnRW

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

func (*AgentLinkConnRW) Read

func (inst *AgentLinkConnRW) Read(name string) (string, error)

func (*AgentLinkConnRW) ReadOptional

func (inst *AgentLinkConnRW) ReadOptional(name, def string) string

func (*AgentLinkConnRW) Write

func (inst *AgentLinkConnRW) Write(name, value string)

type Client

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

func NewClient

func NewClient(config *Config) (*Client, error)

func (*Client) Connect

func (inst *Client) Connect() error

func (*Client) Disconnect

func (inst *Client) Disconnect() error

func (*Client) Init

func (inst *Client) Init(config *Config) error

type Config

type Config struct {
	Host           string
	Port           int
	HandlerFactory HandlerFactory
}

type Connection

type Connection interface {
	io.Closer
	GetReader() Reader
	GetWriter() Writer
}

type Handler

type Handler interface {
	Init(conn Connection) error
	Handle(name, value string, conn Connection) error
}

type HandlerFactory

type HandlerFactory interface {
	NewHandler() Handler
}

type Listener

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

type Reader

type Reader interface {
	ReadOptional(name, def string) string
	Read(name string) (string, error)
}

type Server

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

func NewServer

func NewServer(config *Config) (*Server, error)

func (*Server) Init

func (inst *Server) Init(config *Config) error

func (*Server) Join

func (inst *Server) Join() error

func (*Server) Start

func (inst *Server) Start() error

func (*Server) Stop

func (inst *Server) Stop() error

type Writer

type Writer interface {
	Write(name, value string)
}

Jump to

Keyboard shortcuts

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