Documentation
¶
Index ¶
- func Login(conn Conn, userID, password string) error
- type BehaviorOptions
- func (f *BehaviorOptions) GetFetchSize() int
- func (f *BehaviorOptions) GetParallelism() int
- func (f *BehaviorOptions) GetPriority() int
- func (f *BehaviorOptions) GetTryReconnectNums() int
- func (f *BehaviorOptions) SetFetchSize(fs int) *BehaviorOptions
- func (f *BehaviorOptions) SetParallelism(p int) *BehaviorOptions
- func (f *BehaviorOptions) SetPriority(p int) *BehaviorOptions
- func (f *BehaviorOptions) SetTryReconnectNums(n int) *BehaviorOptions
- type Conn
- type ErrorType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
// Timeout specifies the timeout of the connection.
Timeout time.Duration
// 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 unreached, another address in HighAvailabilitySites will be connected.
EnableHighAvailability bool
// Available only when EnableHighAvailability is true.
HighAvailabilitySites []string
// If true, the address will be reconnected 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
// tryReconnectNums specifies the number of times to try reconnecting
TryReconnectNums *int
// UsePython specifies whether the session uses a Python parser
UsePython bool
// if enable SCRAM login verify
EnableScram 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) GetTryReconnectNums ¶ added in v3.0.3
func (f *BehaviorOptions) GetTryReconnectNums() int
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.
func (*BehaviorOptions) SetTryReconnectNums ¶ added in v3.0.3
func (f *BehaviorOptions) SetTryReconnectNums(n int) *BehaviorOptions
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
// for inner use
GetReader() protocol.Reader
ConnLogin(userID, password string) error
// contains filtered or unexported methods
}
Conn is the interface of DolphinDB conn.