cics

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

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

Go to latest
Published: Feb 27, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

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

This section is empty.

Functions

func ClearString

func ClearString(s string) string

func CloseConnectionPool

func CloseConnectionPool()

func Encrypt

func Encrypt(connectionConfig *ConnectionConfig, ready chan bool) func()

func InitConnectionPool

func InitConnectionPool(config *ConnectionConfig)

func KeyValueParser

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

func Marshal

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

func Pipe

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

func ReturnConnection

func ReturnConnection(cicsConnection *Connection)

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 Connection

type Connection struct {
	ConnectionToken *C.CTG_ConnToken_t
	Config          *ConnectionConfig
}

func GetConnection

func GetConnection() *Connection

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"`
	CorellationIdPoste 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 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() *TransactionError

func (*Routine) TransactParsed

func (cr *Routine) TransactParsed() *TransactionError

func (*Routine) TransactV3

func (cr *Routine) TransactV3() *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 {
	ErrorCode     string `mainframe:"start=1,length=11"`
	ErrorMessage  string `mainframe:"start=12,length=100"`
	ErrorMessage2 string `mainframe:"start=112,length=100"`
}

func (*TransactionError) Error

func (t *TransactionError) Error() string

Jump to

Keyboard shortcuts

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