connector

package
v0.0.0-...-4ba0521 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: BSD-2-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TCPNetwork  = "tcp"
	UnixNetwork = "unix"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

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

func Connect

func Connect(connString string, opts Opts) (*Conn, error)

func (*Conn) Close

func (conn *Conn) Close() error

func (*Conn) Exec

func (conn *Conn) Exec(req *Request) ([]interface{}, error)

func (*Conn) ExecTyped

func (conn *Conn) ExecTyped(req *Request, resData interface{}) error

type ConnOpts

type ConnOpts struct {
	Network  string
	Address  string
	Username string
	Password string
}

type EvalPlainTextOpts

type EvalPlainTextOpts struct {
	ReadTimeout  time.Duration
	PushCallback func(interface{})
	ResData      interface{}
}

type ExecOpts

type ExecOpts struct {
	PushCallback func(interface{})
	ReadTimeout  time.Duration
	ResData      interface{}
}

type Opts

type Opts struct {
	Username string
	Password string
}

type PlainTextEvalRes

type PlainTextEvalRes struct {
	DataEncBase64 string `yaml:"data_enc"`
}

type Protocol

type Protocol string
const (
	PlainTextProtocol Protocol = "plain text"
	BinaryProtocol    Protocol = "binary"

	SimpleOperationTimeout = 3 * time.Second
)

type Request

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

func CallReq

func CallReq(funcName string, args ...interface{}) *Request

func EvalReq

func EvalReq(funcBody string, args ...interface{}) *Request

func (*Request) SetPushCallback

func (req *Request) SetPushCallback(pushCallback func(interface{})) *Request

func (*Request) SetReadTimeout

func (req *Request) SetReadTimeout(readTimeout time.Duration) *Request

Jump to

Keyboard shortcuts

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