network

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptPacket

type AcceptPacket struct {
	Packet
	// contains filtered or unexported fields
}

type AcceptPacket Packet

type AdvNegoSeviceInfo

type AdvNegoSeviceInfo struct {
	AuthService []string
}

type BindError

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

type ClientInfo

type ClientInfo struct {
	ProgramPath string
	ProgramName string
	UserName    string
	Password    string
	HostName    string
	DomainName  string
	DriverName  string
	PID         int
}

type ConnectPacket

type ConnectPacket struct {
	Packet
	// contains filtered or unexported fields
}

type ConnectPacket Packet

type ConnectionOption

type ConnectionOption struct {
	ClientInfo
	DatabaseInfo
	SessionInfo
	AdvNegoSeviceInfo
	Tracer       trace.Tracer
	PrefetchRows int
}

func (*ConnectionOption) AddServer

func (op *ConnectionOption) AddServer(server ServerAddr)

func (*ConnectionOption) ConnectionData

func (op *ConnectionOption) ConnectionData() string

func (*ConnectionOption) GetActiveServer

func (op *ConnectionOption) GetActiveServer(jump bool) *ServerAddr

func (*ConnectionOption) UpdateDatabaseInfo

func (op *ConnectionOption) UpdateDatabaseInfo(connStr string) error

type Data

type Data interface {
	Write(session *Session) error
	Read(session *Session) error
}

type DataPacket

type DataPacket struct {
	Packet
	// contains filtered or unexported fields
}

type DatabaseInfo

type DatabaseInfo struct {
	UserID  string
	Servers []ServerAddr

	SID             string
	ProxyClientName string
	ServiceName     string
	InstanceName    string
	DBName          string
	AuthType        int
	// contains filtered or unexported fields
}

type MarkerPacket

type MarkerPacket struct {
	Packet
	// contains filtered or unexported fields
}

type OracleError

type OracleError struct {
	ErrCode int
	ErrMsg  string
}

func (*OracleError) Error

func (err *OracleError) Error() string

type Packet

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

type PacketInterface

type PacketInterface interface {
	// contains filtered or unexported methods
}

type PacketType

type PacketType uint8
const (
	CONNECT  PacketType = 1
	ACCEPT   PacketType = 2
	ACK      PacketType = 3
	REFUSE   PacketType = 4
	REDIRECT PacketType = 5
	DATA     PacketType = 6
	NULL     PacketType = 7
	ABORT    PacketType = 9
	RESEND   PacketType = 11
	MARKER   PacketType = 12
	ATTN     PacketType = 13
	CTRL     PacketType = 14
	HIGHEST  PacketType = 19
)

type RedirectPacket

type RedirectPacket struct {
	Packet
	// contains filtered or unexported fields
}

type RefusePacket

type RefusePacket struct {
	Packet
	Err          OracleError
	SystemReason uint8
	UserReason   uint8
	// contains filtered or unexported fields
}

type ServerAddr

type ServerAddr struct {
	Protocol string
	Addr     string
	Port     int
}

func (*ServerAddr) IsEqual

func (serv *ServerAddr) IsEqual(input *ServerAddr) bool

type Session

type Session struct {

	//connOption        ConnectionOption
	Context *SessionContext

	TimeZone          []byte
	TTCVersion        uint8
	HasEOSCapability  bool
	HasFSAPCapability bool
	Summary           *SummaryObject

	StrConv converters.IStringConverter
	// contains filtered or unexported fields
}

func NewSession

func NewSession(connOption *ConnectionOption) *Session

func (*Session) Connect

func (session *Session) Connect(ctx context.Context) error

func (*Session) Disconnect

func (session *Session) Disconnect()

func (*Session) EndContext

func (session *Session) EndContext()

func (*Session) GetByte

func (session *Session) GetByte() (uint8, error)

func (*Session) GetBytes

func (session *Session) GetBytes(length int) ([]byte, error)

func (*Session) GetClr

func (session *Session) GetClr() (output []byte, err error)

func (*Session) GetData

func (session *Session) GetData(data Data) error

func (*Session) GetDlc

func (session *Session) GetDlc() (output []byte, err error)

func (*Session) GetError

func (session *Session) GetError() string

func (*Session) GetInt

func (session *Session) GetInt(size int, compress bool, bigEndian bool) (int, error)

func (*Session) GetInt64

func (session *Session) GetInt64(size int, compress bool, bigEndian bool) (int64, error)

func (*Session) GetKeyVal

func (session *Session) GetKeyVal() (key []byte, val []byte, num int, err error)

return key, val, int and error

func (*Session) GetNullTermString

func (session *Session) GetNullTermString(maxSize int) (result string, err error)

func (*Session) HasError

func (session *Session) HasError() bool

func (*Session) LoadState

func (session *Session) LoadState() (oldState *SessionState)

func (*Session) PutBytes

func (session *Session) PutBytes(data ...byte)

func (*Session) PutClr

func (session *Session) PutClr(data []byte)

func (*Session) PutData

func (session *Session) PutData(data Data) error

func (*Session) PutInt

func (session *Session) PutInt(number interface{}, size uint8, bigEndian bool, compress bool)

func (*Session) PutKeyVal

func (session *Session) PutKeyVal(key []byte, val []byte, num uint8)

func (*Session) PutKeyValString

func (session *Session) PutKeyValString(key string, val string, num uint8)

func (*Session) PutUint

func (session *Session) PutUint(number interface{}, size uint8, bigEndian bool, compress bool)

func (*Session) ResetBuffer

func (session *Session) ResetBuffer()

ResetBuffer empty in and out buffer and set read index to 0

func (*Session) SaveState

func (session *Session) SaveState(newState *SessionState)

func (*Session) StartContext

func (session *Session) StartContext(ctx context.Context)

func (*Session) Write

func (session *Session) Write() error

type SessionContext

type SessionContext struct {

	//PortNo int
	//InstanceName string
	//HostName string
	//IPAddress string
	//Protocol string
	//ServiceName string
	SID []byte
	//internal Stream m_socketStream;
	//internal Socket m_socket;
	//internal ReaderStream m_readerStream;
	//internal WriterStream m_writerStream;
	//internal ITransportAdapter m_transportAdapter;
	//ConnectData string
	Version           uint16
	LoVersion         uint16
	Options           uint16
	NegotiatedOptions uint16
	OurOne            uint16
	Histone           uint16
	ReconAddr         string

	ACFL0               uint8
	ACFL1               uint8
	SessionDataUnit     uint16
	TransportDataUnit   uint16
	UsingAsyncReceivers bool
	IsNTConnected       bool
	OnBreakReset        bool
	GotReset            bool
	// contains filtered or unexported fields
}

func NewSessionContext

func NewSessionContext(connOption *ConnectionOption) *SessionContext

NewSessionContext create session context from connection option

type SessionInfo

type SessionInfo struct {
	SSLVersion            string
	Timeout               time.Duration
	UnixAddress           string
	TransportDataUnitSize uint32
	SessionDataUnitSize   uint32
	Protocol              string
	SSL                   bool
	SSLVerify             bool
}

type SessionState

type SessionState struct {
	InBuffer  []byte
	OutBuffer bytes.Buffer
	// contains filtered or unexported fields
}

type SummaryObject

type SummaryObject struct {
	EndOfCallStatus      int // uint32
	EndToEndECIDSequence int // uint16
	CurRowNumber         int // uint32
	RetCode              int // uint16

	CursorID int // uint16

	Flags uint8 // uint16

	ErrorMessage []byte
	// contains filtered or unexported fields
}

SummaryObject this object carry summary about last operation from the server including error

func NewSummary

func NewSummary(session *Session) (*SummaryObject, error)

NewSummary create new summary object by read data from the session

type WarningObject

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

func NewWarningObject

func NewWarningObject(session *Session) (*WarningObject, error)

NewWarningObject create new warning object by read data from session

Jump to

Keyboard shortcuts

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