Documentation ¶
Index ¶
- Constants
- Variables
- func ChannelClosure()
- func ClearString(s string) string
- func CloseConnectionPool()
- func Encrypt(connectionConfig *ConnectionConfig, ready chan bool)
- func InitConnectionPool(config *ConnectionConfig, reg *prometheus.Registerer) error
- func KeyValueParser(s string) (map[string]string, error)
- func ListeningClosure()
- func Marshal(v interface{}) ([]byte, error)
- func Pipe(conn1 net.Conn, conn2 net.Conn)
- func ReturnConnection(cicsConnection *Connection) error
- func Unmarshal(data []byte, v any) error
- type BufferWritePosition
- type CicsEvictionPolicy
- type Connection
- type ConnectionConfig
- type ConnectionFactory
- func (f *ConnectionFactory) ActivateObject(ctx context.Context, object *pool.PooledObject) error
- func (f *ConnectionFactory) DestroyObject(ctx context.Context, object *pool.PooledObject) error
- func (f *ConnectionFactory) MakeObject(ctx context.Context) (*pool.PooledObject, error)
- func (f *ConnectionFactory) PassivateObject(ctx context.Context, object *pool.PooledObject) error
- func (f *ConnectionFactory) ValidateObject(ctx context.Context, object *pool.PooledObject) bool
- type Container
- type Header
- type HeaderV2
- type HeaderV3
- type MainframeTag
- type Metrics
- type RequestInfo
- type Routine
- type RoutineConfig
- type TransactionError
Constants ¶
View Source
const CICSLIBERRORCODE = "99999"
View Source
const CONVERSION = "N"
View Source
const DEBUG = "N"
View Source
const ERRORE = "ERRORE"
View Source
const HEADER = "HEADER"
View Source
const INPUT = "INPUT"
View Source
const OUTPUT = "OUTPUT"
Variables ¶
View Source
var EciChannel chan *C.ECI_ChannelToken_t
View Source
var TokenChannel chan *C.CTG_ConnToken_t
Functions ¶
func ChannelClosure ¶
func ChannelClosure()
func ClearString ¶
func CloseConnectionPool ¶
func CloseConnectionPool()
func Encrypt ¶
func Encrypt(connectionConfig *ConnectionConfig, ready chan bool)
func InitConnectionPool ¶
func InitConnectionPool(config *ConnectionConfig, reg *prometheus.Registerer) error
func ListeningClosure ¶
func ListeningClosure()
func ReturnConnection ¶
func ReturnConnection(cicsConnection *Connection) error
Types ¶
type BufferWritePosition ¶
type BufferWritePosition struct {
Buf []byte
}
func (*BufferWritePosition) Cap ¶
func (b *BufferWritePosition) Cap() int
func (*BufferWritePosition) Len ¶
func (b *BufferWritePosition) Len() int
func (*BufferWritePosition) String ¶
func (b *BufferWritePosition) String() string
func (*BufferWritePosition) WriteString ¶
func (b *BufferWritePosition) WriteString(s string) (int, error)
func (*BufferWritePosition) WriteStringPosition ¶
func (b *BufferWritePosition) WriteStringPosition(s string, i int)
type CicsEvictionPolicy ¶
type CicsEvictionPolicy struct { }
func (*CicsEvictionPolicy) Evict ¶
func (p *CicsEvictionPolicy) Evict(config *pool.EvictionConfig, underTest *pool.PooledObject, idleCount int) bool
Evict do evict by config
type Connection ¶
type Connection struct { ConnectionToken *C.CTG_ConnToken_t Config *ConnectionConfig }
func GetConnection ¶
func GetConnection() (*Connection, error)
type ConnectionConfig ¶
type ConnectionConfig struct { Hostname string `mapstructure:"hostname"` Port int `mapstructure:"port"` Timeout int `mapstructure:"timeout"` UserName string `mapstructure:"username"` Password string `mapstructure:"password"` ServerName string `mapstructure:"servername"` ProxyPort int `mapstructure:"proxyport"` InsecureSkipVerify bool `mapstructure:"skv"` UseProxy bool `mapstructure:"useproxy"` MaxTotal int `mapstructure:"connectionnumber"` MaxIdle int `mapstructure:"maxidle"` MinIdle int `mapstructure:"minidle"` MaxIdleLifeTime int `mapstructure:"maxidlelifetime"` SSLRootCaCertificate string `mapstructure:"sslrootcacertificate"` SSLClientKey string `mapstructure:"sslclientkey"` SSLClientCertificate string `mapstructure:"sslclientcertificate"` }
type ConnectionFactory ¶
type ConnectionFactory struct {
Config *ConnectionConfig
}
func (*ConnectionFactory) ActivateObject ¶
func (f *ConnectionFactory) ActivateObject(ctx context.Context, object *pool.PooledObject) error
func (*ConnectionFactory) DestroyObject ¶
func (f *ConnectionFactory) DestroyObject(ctx context.Context, object *pool.PooledObject) error
func (*ConnectionFactory) MakeObject ¶
func (f *ConnectionFactory) MakeObject(ctx context.Context) (*pool.PooledObject, error)
func (*ConnectionFactory) PassivateObject ¶
func (f *ConnectionFactory) PassivateObject(ctx context.Context, object *pool.PooledObject) error
func (*ConnectionFactory) ValidateObject ¶
func (f *ConnectionFactory) ValidateObject(ctx context.Context, object *pool.PooledObject) bool
type HeaderV2 ¶
type HeaderV2 struct { ABIBanca string `mainframe:"start=1,length=5"` ProgramName string `mainframe:"start=6,length=8" validate:"required"` Conversion string `mainframe:"start=14,length=1"` FlagDebug string `mainframe:"start=15,length=1"` LogLevel string `mainframe:"start=16,length=1"` CicsResponseCode string `mainframe:"start=17,length=3"` CicsResponse2Code string `mainframe:"start=20,length=3"` CicsAbendCode string `mainframe:"start=23,length=4"` ErrorDescription string `mainframe:"start=27,length=30"` RequestIdClient string `mainframe:"start=57,length=255"` CorrelationIdPoste string `mainframe:"start=312,length=100"` RequestIdLegacy string `mainframe:"start=412,length=100"` TransId string `mainframe:"start=512,length=4"` }
func BuildHeaderV2 ¶
func BuildHeaderV2(RequestInfo *RequestInfo, config *RoutineConfig) *HeaderV2
type HeaderV3 ¶
type HeaderV3 struct { Version string `mainframe:"start=1,length=6"` ProgramName string `mainframe:"start=7,length=8"` TransId string `mainframe:"start=15,length=4"` SystemId string `mainframe:"start=19,length=8"` Canale string `mainframe:"start=27,length=8"` Conversion string `mainframe:"start=35,length=1"` FlagDebug string `mainframe:"start=36,length=1"` LogLevel string `mainframe:"start=37,length=1"` RollBack string `mainframe:"start=38,length=1"` ReturnCode string `mainframe:"start=39,length=5"` ErrorDescription string `mainframe:"start=44,length=30"` FlagCheckIdem string `mainframe:"start=74,length=1"` CicsTargetPool string `mainframe:"start=75,length=4"` TrackingId string `mainframe:"start=79,length=100"` RequestId string `mainframe:"start=179,length=100"` SubRequestId string `mainframe:"start=279,length=12"` }
func BuildHeaderV3 ¶
func BuildHeaderV3(requestInfo *RequestInfo, config *RoutineConfig) *HeaderV3
type MainframeTag ¶
type MainframeTag struct {
// contains filtered or unexported fields
}
type Metrics ¶
type Metrics struct { GetConnection prometheus.Counter ReturnedConnection prometheus.Counter ActiveConnection prometheus.Gauge CreateConnection prometheus.Counter DestroyConnection prometheus.Counter }
func NewMetrics ¶
func NewMetrics(reg prometheus.Registerer) *Metrics
type RequestInfo ¶
type Routine ¶
type Routine struct { Config *RoutineConfig Connection *Connection InputContainer map[string][]byte OutputContainer map[string][]byte }
func (*Routine) TransactParsed ¶
func (cr *Routine) TransactParsed() *TransactionError
func (*Routine) TransactV3 ¶
func (cr *Routine) TransactV3(ctx context.Context) *TransactionError
type RoutineConfig ¶
type TransactionError ¶
type TransactionError struct { Status int `json:"-"` ErrorCode string `json:"ErrorCode" mainframe:"start=1,length=11"` ErrorMessage string `json:"ErrorMessage" mainframe:"start=12,length=100"` ErrorMessage2 string `json:"ErrorMessage2" mainframe:"start=112,length=100"` }
func TransactionErrorFromError ¶
func TransactionErrorFromError(err error) *TransactionError
func (*TransactionError) Error ¶
func (t *TransactionError) Error() string
func (*TransactionError) GetStatus ¶
func (e *TransactionError) GetStatus() int
Click to show internal directories.
Click to hide internal directories.