Documentation
¶
Index ¶
- Variables
- type AcceptPacket
- type BindError
- type ConnectPacket
- type Data
- type DataPacket
- type MarkerPacket
- type OracleError
- type Packet
- type PacketInterface
- type PacketType
- type RedirectPacket
- type RefusePacket
- type Session
- func (session *Session) BreakConnection() error
- func (session *Session) Connect(ctx context.Context) error
- func (session *Session) Disconnect()
- func (session *Session) EndContext(done chan struct{})
- func (session *Session) GetByte() (uint8, error)
- func (session *Session) GetBytes(length int) ([]byte, error)
- func (session *Session) GetClr() (output []byte, err error)
- func (session *Session) GetDlc() (output []byte, err error)
- func (session *Session) GetError() *OracleError
- func (session *Session) GetFixedClr() ([]byte, error)
- func (session *Session) GetInt(size int, compress bool, bigEndian bool) (int, error)
- func (session *Session) GetInt64(size int, compress bool, bigEndian bool) (int64, error)
- func (session *Session) GetKeyVal() (key []byte, val []byte, num int, err error)
- func (session *Session) GetNullTermString(maxSize int) (result string, err error)
- func (session *Session) GetString(length int) (string, error)
- func (session *Session) HasError() bool
- func (session *Session) IsBreak() bool
- func (session *Session) LoadSSLData(certs, keys, certRequests [][]byte) error
- func (session *Session) LoadState() (oldState *SessionState)
- func (session *Session) Peek(numBytes int) ([]byte, error)
- func (session *Session) PutBytes(data ...byte)
- func (session *Session) PutClr(data []byte)
- func (session *Session) PutInt(number interface{}, size uint8, bigEndian bool, compress bool)
- func (session *Session) PutKeyVal(key []byte, val []byte, num uint8)
- func (session *Session) PutKeyValString(key string, val string, num uint8)
- func (session *Session) PutString(data string)
- func (session *Session) PutUint(number interface{}, size uint8, bigEndian, compress bool)
- func (session *Session) ResetBreak()
- func (session *Session) ResetBuffer()
- func (session *Session) RestoreIndex() bool
- func (session *Session) SaveState(newState *SessionState)
- func (session *Session) SetConnected()
- func (session *Session) StartContext(ctx context.Context) chan struct{}
- func (session *Session) Write() error
- func (session *Session) WriteBytes(buffer *bytes.Buffer, data ...byte)
- func (session *Session) WriteClr(buffer *bytes.Buffer, data []byte)
- func (session *Session) WriteFinalPacket() error
- func (session *Session) WriteFixedClr(buffer *bytes.Buffer, data []byte)
- func (session *Session) WriteInt(buffer *bytes.Buffer, number interface{}, size uint8, bigEndian, compress bool)
- func (session *Session) WriteKeyVal(buffer *bytes.Buffer, key []byte, val []byte, num uint8)
- func (session *Session) WriteKeyValString(buffer *bytes.Buffer, key string, val string, num uint8)
- func (session *Session) WriteUint(buffer *bytes.Buffer, number interface{}, size uint8, bigEndian, compress bool)
- type SessionContext
- type SessionState
- type SummaryObject
- type WarningObject
Constants ¶
This section is empty.
Variables ¶
var ErrConnReset = errors.New("connection break due to context timeout")
Functions ¶
This section is empty.
Types ¶
type AcceptPacket ¶
type AcceptPacket struct {
Packet
// contains filtered or unexported fields
}
type AcceptPacket Packet
type ConnectPacket ¶
type ConnectPacket struct {
Packet
// contains filtered or unexported fields
}
type ConnectPacket Packet
type DataPacket ¶
type DataPacket struct {
Packet
// contains filtered or unexported fields
}
type MarkerPacket ¶
type MarkerPacket struct {
Packet
// contains filtered or unexported fields
}
type OracleError ¶ added in v2.2.8
func NewOracleError ¶ added in v2.9.0
func NewOracleError(errCode int) *OracleError
func (*OracleError) Bad ¶ added in v2.7.20
func (err *OracleError) Bad() bool
func (*OracleError) ErrPos ¶ added in v2.8.23
func (err *OracleError) ErrPos() int
ErrPos return sql error position。
func (*OracleError) Error ¶ added in v2.2.8
func (err *OracleError) Error() string
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 Session ¶
type Session struct {
Context *SessionContext
// doneContext []chan struct{}
TimeZone []byte
TTCVersion uint8
HasEOSCapability bool
HasFSAPCapability bool
Summary *SummaryObject
StrConv converters.IStringConverter
UseBigClrChunks bool
UseBigScn bool
ClrChunkSize int
Connected bool
// resetConn bool
SSL struct {
CertificateRequest []*x509.CertificateRequest
PrivateKeys []*rsa.PrivateKey
Certificates []*x509.Certificate
// contains filtered or unexported fields
}
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession(config *configurations.ConnectionConfig, tracer trace.Tracer) *Session
func NewSessionWithInputBufferForDebug ¶ added in v2.4.21
func (*Session) BreakConnection ¶ added in v2.5.17
BreakConnection elicit connection break to cancel the current operation
func (*Session) Connect ¶
Connect perform network connection on address:port check if the client need to use SSL then send connect packet to the server and receive either accept, redirect or refuse packet
func (*Session) Disconnect ¶
func (session *Session) Disconnect()
Disconnect close the network and release resources
func (*Session) EndContext ¶ added in v2.4.1
func (session *Session) EndContext(done chan struct{})
func (*Session) GetError ¶
func (session *Session) GetError() *OracleError
GetError Return the error in form or OracleError
func (*Session) GetFixedClr ¶ added in v2.8.20
func (*Session) GetInt ¶
GetInt read int number from input buffer. you should specify the size of the int and either compress or not and stored as big endian or not
func (*Session) GetInt64 ¶
GetInt64 read int64 number from input buffer.
you should specify the size of the int and either compress or not and stored as big endian or not
func (*Session) GetKeyVal ¶
GetKeyVal read key, value (in form of bytearray), a number flag from input buffer
func (*Session) GetNullTermString ¶
GetNullTermString read a null terminated string from input buffer
func (*Session) LoadSSLData ¶ added in v2.2.1
LoadSSLData load data required for SSL connection like certificate, private keys and certificate requests
func (*Session) LoadState ¶
func (session *Session) LoadState() (oldState *SessionState)
LoadState load last saved session state and return the current state if this is the only session state available set session state memory to nil
func (*Session) PutInt ¶
PutInt write int number with size entered either use bigEndian or not and use compression or not to
func (*Session) PutKeyVal ¶
PutKeyVal write key, val (in form of bytearray) and flag number to output buffer
func (*Session) PutKeyValString ¶
PutKeyValString write key, val (in form of string) and flag number to output buffer
func (*Session) PutUint ¶
PutUint write uint number with size entered either use bigEndian or not and use compression or not to
func (*Session) ResetBreak ¶ added in v2.8.0
func (session *Session) ResetBreak()
func (*Session) ResetBuffer ¶
func (session *Session) ResetBuffer()
ResetBuffer empty in and out buffer and set read index to 0
func (*Session) RestoreIndex ¶ added in v2.8.0
func (*Session) SaveState ¶
func (session *Session) SaveState(newState *SessionState)
SaveState save current session state and accept new state if new state is nil the session will be reset
func (*Session) SetConnected ¶ added in v2.8.12
func (session *Session) SetConnected()
func (*Session) StartContext ¶ added in v2.4.1
func (*Session) Write ¶
Write send data store in output buffer through network
if data bigger than fSessionDataUnit it should be divided into segment and each segment sent in data packet
func (*Session) WriteBytes ¶ added in v2.2.23
func (*Session) WriteFinalPacket ¶ added in v2.8.0
func (*Session) WriteFixedClr ¶ added in v2.8.7
func (*Session) WriteInt ¶ added in v2.2.23
func (session *Session) WriteInt(buffer *bytes.Buffer, number interface{}, size uint8, bigEndian, compress bool)
WriteInt write int data to external buffer
func (*Session) WriteKeyVal ¶ added in v2.2.23
WriteKeyVal write key, val, flag number to external buffer
func (*Session) WriteKeyValString ¶ added in v2.2.23
WriteKeyValString write key, val (in form of string) and flag number to external buffer
type SessionContext ¶
type SessionContext struct {
// conn net.Conn
// ConnOption *ConnectionOption
// PortNo int
// InstanceName string
// HostName string
// IPAddress string
// Protocol string
// ServiceName string
SID []byte
Version uint16
LoVersion uint16
Options uint16
NegotiatedOptions uint16
OurOne uint16
Histone uint16
ReconAddr string
ACFL0 uint8
ACFL1 uint8
SessionDataUnit uint32
TransportDataUnit uint32
UsingAsyncReceivers bool
IsNTConnected bool
OnBreakReset bool
GotReset bool
AdvancedService struct {
CryptAlgo security.OracleNetworkEncryption
HashAlgo security.OracleNetworkDataIntegrity
SessionKey []byte
IV []byte
}
// contains filtered or unexported fields
}
func NewSessionContext ¶
func NewSessionContext(config *configurations.ConnectionConfig) *SessionContext
type SessionState ¶ added in v2.2.24
type SummaryObject ¶
type SummaryObject struct {
EndOfCallStatus int // uint32
EndToEndECIDSequence int // uint16
CurRowNumber int // uint32
RetCode int // uint16
CursorID int // uint16
Flags int // uint16
ErrorMessage []byte
// contains filtered or unexported fields
}
func NewSummary ¶
func NewSummary(session *Session) (*SummaryObject, error)
type WarningObject ¶
type WarningObject struct {
// contains filtered or unexported fields
}
func NewWarningObject ¶
func NewWarningObject(session *Session) (*WarningObject, error)