dialer

package
v1.30.23 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BehaviorOptions

type BehaviorOptions struct {
	// Priority specifies the priority of the task
	Priority *int
	// Parallelism specifies the parallelism of the task
	Parallelism *int
	// FetchSize specifies the fetchSize of the task
	FetchSize *int

	// Whether to enable load balancing.
	// If true, connect to the address with the fewest connections.
	LoadBalance bool

	// Whether to enable high availability.
	// If true, when the address is unrearched, another address in HighAvailabilitySites will be connected.
	EnableHighAvailability bool

	// Available only when EnableHighAvailability is true.
	HighAvailabilitySites []string

	// If true, the address will be reconncted util the server is ready.
	Reconnect bool

	// IsReverseStreaming specifies whether the job is a reverse stream subscription
	IsReverseStreaming bool
	// IsClearSessionMemory specifies whether to clear session memory after the job
	IsClearSessionMemory bool
}

BehaviorOptions helps you configure behavior identity. Refer to https://github.com/dolphindb/Tutorials_CN/blob/master/api_protocol.md#254-%E8%A1%8C%E4%B8%BA%E6%A0%87%E8%AF%86 for more details.

func (*BehaviorOptions) GetFetchSize

func (f *BehaviorOptions) GetFetchSize() int

GetFetchSize gets the fetchSize of the task.

func (*BehaviorOptions) GetParallelism

func (f *BehaviorOptions) GetParallelism() int

GetParallelism gets the parallelism of the task.

func (*BehaviorOptions) GetPriority

func (f *BehaviorOptions) GetPriority() int

GetPriority gets the priority of the task.

func (*BehaviorOptions) SetFetchSize

func (f *BehaviorOptions) SetFetchSize(fs int) *BehaviorOptions

SetFetchSize sets the fetchSize of the task.

func (*BehaviorOptions) SetParallelism

func (f *BehaviorOptions) SetParallelism(p int) *BehaviorOptions

SetParallelism sets the parallelism of the task.

func (*BehaviorOptions) SetPriority

func (f *BehaviorOptions) SetPriority(p int) *BehaviorOptions

SetPriority sets the priority of the task.

type Conn

type Conn interface {
	net.Conn

	// Connect connects to dolphindb server
	Connect() error
	// GetLocalAddress gets the local address with the connection
	GetLocalAddress() string

	//  RefreshTimeout resets the timeout of the connection
	RefreshTimeout(t time.Duration)
	// GetSession gets the session id of the connection
	GetSession() string
	// Close closes the connection with server
	Close() error
	// IsClosed checks whether the connection is closed
	IsClosed() bool
	// IsConnected checks whether the connection is connected
	IsConnected() bool

	// GetUserID gets the userID
	GetUserID() string
	// SetUserID sets the userID
	SetUserID(userID string)
	// GetPassword gets the password
	GetPassword() string
	// SetPassword sets the password
	SetPassword(password string)

	// RunScript sends script to dolphindb and returns the execution result
	RunScript(s string) (model.DataForm, error)
	// RunFile sends script from a specific file to dolphindb and returns the execution result
	RunFile(path string) (model.DataForm, error)
	// RunFunc sends function request to dolphindb and returns the execution result.
	// See DolphinDB function and command references: https://www.dolphindb.cn/cn/help/130/FunctionsandCommands/FunctionReferences/index.html
	RunFunc(s string, args []model.DataForm) (model.DataForm, error)
	// Upload sends local objects to dolphindb server and the specified variable is generated on the dolphindb
	Upload(vars map[string]model.DataForm) (model.DataForm, error)
	// GetTCPConn returns the TCPConn
	GetTCPConn() *net.TCPConn

	GetReader() protocol.Reader
}

Conn is the interface of DolphinDB conn.

func NewConn

func NewConn(ctx context.Context, addr string, behaviorOpt *BehaviorOptions) (Conn, error)

NewConn instantiates a new connection with the addr. BehaviorOpt will affect every request sent by conn. You can input opts to configure conn.

func NewSimpleConn

func NewSimpleConn(ctx context.Context, address, userID, pwd string) (Conn, error)

NewSimpleConn instantiates a new connection with the addr, which connects to the server and logs in with the userID and pwd.

type ErrorType added in v1.30.22

type ErrorType int
const (
	IGNORE ErrorType = iota
	UNKNOW
	NEWLEADER
	NODENOTAVAIL
	NOINITIALIZED
	UNEXPECT
)

Directories

Path Synopsis
Package protocol contains functions for zero-copy casting between typed slices and byte slices.
Package protocol contains functions for zero-copy casting between typed slices and byte slices.

Jump to

Keyboard shortcuts

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