cics

package
v0.0.0-...-3bc55ad Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

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 ClearString(s string) string

func CloseConnectionPool

func CloseConnectionPool()

func Encrypt

func Encrypt(connectionConfig *ConnectionConfig, ready chan bool)

func InitConnectionPool

func InitConnectionPool(config *ConnectionConfig, reg *prometheus.Registerer) error

func KeyValueParser

func KeyValueParser(s string) (map[string]string, error)

func ListeningClosure

func ListeningClosure()

func Marshal

func Marshal(v interface{}) ([]byte, error)

func Pipe

func Pipe(conn1 net.Conn, conn2 net.Conn)

func ReturnConnection

func ReturnConnection(cicsConnection *Connection) error

func Unmarshal

func Unmarshal(data []byte, v any) 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 Container

type Container struct{}
type Header interface {
	IsError() 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

func (*HeaderV2) IsError

func (header *HeaderV2) IsError() bool

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

func (*HeaderV3) IsError

func (header *HeaderV3) IsError() bool

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 RequestInfo struct {
	RequestId             string
	TrackId               string
	SystemId              string
	Canale                string
	OrchestrationSequence int
	TransactionSequence   int
}

type Routine

type Routine struct {
	Config          *RoutineConfig
	Connection      *Connection
	InputContainer  map[string][]byte
	OutputContainer map[string][]byte
}

func (*Routine) Transact

func (cr *Routine) Transact(ctx context.Context) *TransactionError

func (*Routine) TransactParsed

func (cr *Routine) TransactParsed() *TransactionError

func (*Routine) TransactV3

func (cr *Routine) TransactV3(ctx context.Context) *TransactionError

type RoutineConfig

type RoutineConfig struct {
	Name            string `mapstructure:"name"`
	ChannelName     string `mapstructure:"channelname"`
	ProgramName     string `mapstructure:"programname"`
	CicsGatewayName string `mapstructure:"cicsgatewayname"`
	TransId         string `mapstructure:"transid"`
}

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

Jump to

Keyboard shortcuts

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