udp

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	UDP_PACK_VERSION = 50100

	TX_BLANK uint8 = 0
	TX_START uint8 = 1

	TX_DB_CONN   uint8 = 2
	TX_DB_FETCH  uint8 = 3
	TX_SQL       uint8 = 4
	TX_SQL_START uint8 = 5
	TX_SQL_END   uint8 = 6

	TX_HTTPC       uint8 = 7
	TX_HTTPC_START uint8 = 8
	TX_HTTPC_END   uint8 = 9

	TX_ERROR  uint8 = 10
	TX_MSG    uint8 = 11
	TX_METHOD uint8 = 12

	// secure msg
	TX_SECURE_MSG uint8 = 13

	// sql & param
	TX_SQL_PARAM uint8 = 14

	TX_PARAM     uint8 = 30
	ACTIVE_STACK uint8 = 40
	ACTIVE_STATS uint8 = 41
	DBCONN_POOL  uint8 = 42

	// golang config
	CONFIG_INFO uint8 = 230

	// relay pack
	RELAY_PACK uint8 = 244

	TX_START_END            uint8 = 254
	TX_END                  uint8 = 255
	UDP_PACKET_SQL_MAX_SIZE       = 32768
)
View Source
const (
	PACKET_DB_MAX_SIZE           = 4 * 1024  // max size of sql
	PACKET_SQL_MAX_SIZE          = 32 * 1024 // max size of sql
	PACKET_HTTPC_MAX_SIZE        = 32 * 1024 // max size of sql
	PACKET_MESSAGE_MAX_SIZE      = 32 * 1024 // max size of message
	PACKET_METHOD_STACK_MAX_SIZE = 32 * 1024 // max size of message

	COMPILE_FILE_MAX_SIZE = 2 * 1024 // max size of filename

	HTTP_HOST_MAX_SIZE   = 2 * 1024 // max size of host
	HTTP_URI_MAX_SIZE    = 2 * 1024 // max size of uri
	HTTP_METHOD_MAX_SIZE = 256      // max size of method
	HTTP_IP_MAX_SIZE     = 256      // max size of ip(request_addr)
	HTTP_UA_MAX_SIZE     = 2 * 1024 // max size of user agent
	HTTP_REF_MAX_SIZE    = 2 * 1024 // max size of referer
	HTTP_USERID_MAX_SIZE = 2 * 1024 // max size of userid

	HTTP_PARAM_MAX_COUNT      = 20
	HTTP_PARAM_KEY_MAX_SIZE   = 255 // = 을 빼고 255 byte
	HTTP_PARAM_VALUE_MAX_SIZE = 256

	HTTP_HEADER_MAX_COUNT      = 20
	HTTP_HEADER_KEY_MAX_SIZE   = 255 // = 을 빼고 255 byte
	HTTP_HEADER_VALUE_MAX_SIZE = 256

	SQL_PARAM_MAX_COUNT      = 20
	SQL_PARAM_VALUE_MAX_SIZE = 256

	STEP_ERROR_MESSAGE_MAX_SIZE = 4 * 1024
)

Variables

This section is empty.

Functions

func ClosePack

func ClosePack(p UdpPack)

func ParseHeader

func ParseHeader(m map[string][]string, maxCount, keyMaxSize, valueMaxSize int) string

func ParseParameter

func ParseParameter(m map[string][]string, maxCount, keyMaxSize, valueMaxSize int) string

func ToBytesPack

func ToBytesPack(p UdpPack) []byte

func WritePack

func WritePack(out *io.DataOutputX, p UdpPack) *io.DataOutputX

Types

type AbstractPack

type AbstractPack struct {
	Ver      int32
	Txid     int64
	Time     int64
	Elapsed  int32
	Cpu      int64
	Mem      int64
	Pid      int32
	ThreadId int64

	Flush bool
}

func (*AbstractPack) Clear

func (this *AbstractPack) Clear()

func (*AbstractPack) GetVersion

func (this *AbstractPack) GetVersion() int32

oid 설정 pack interface

func (*AbstractPack) IsFlush

func (this *AbstractPack) IsFlush() bool

func (*AbstractPack) Read

func (this *AbstractPack) Read(din *io.DataInputX)

func (*AbstractPack) SetFlush

func (this *AbstractPack) SetFlush(flush bool)

func (*AbstractPack) SetVersion

func (this *AbstractPack) SetVersion(ver int32)

oid 설정 pack interface

func (*AbstractPack) ToString

func (this *AbstractPack) ToString() string

func (*AbstractPack) Write

func (this *AbstractPack) Write(dout *io.DataOutputX)

type UdpActiveStackPack

type UdpActiveStackPack struct {
	AbstractPack
	Data  string
	TxId  int64
	Stack string
}

func NewUdpActiveStackPack

func NewUdpActiveStackPack() *UdpActiveStackPack

func NewUdpActiveStackPackVer

func NewUdpActiveStackPackVer(ver int32) *UdpActiveStackPack

func (*UdpActiveStackPack) Clear

func (this *UdpActiveStackPack) Clear()

func (*UdpActiveStackPack) GetPackType

func (this *UdpActiveStackPack) GetPackType() uint8

func (*UdpActiveStackPack) Process

func (this *UdpActiveStackPack) Process()

func (*UdpActiveStackPack) Read

func (this *UdpActiveStackPack) Read(din *io.DataInputX)

func (*UdpActiveStackPack) ToString

func (this *UdpActiveStackPack) ToString() string

func (*UdpActiveStackPack) Write

func (this *UdpActiveStackPack) Write(dout *io.DataOutputX)

type UdpActiveStatsPack

type UdpActiveStatsPack struct {
	AbstractPack
	Data        string
	ActiveStats []int16
}

func NewUdpActiveStatsPack

func NewUdpActiveStatsPack() *UdpActiveStatsPack

func NewUdpActiveStatsPackVer

func NewUdpActiveStatsPackVer(ver int32) *UdpActiveStatsPack

func (*UdpActiveStatsPack) Clear

func (this *UdpActiveStatsPack) Clear()

func (*UdpActiveStatsPack) GetPackType

func (this *UdpActiveStatsPack) GetPackType() uint8

func (*UdpActiveStatsPack) Process

func (this *UdpActiveStatsPack) Process()

func (*UdpActiveStatsPack) Read

func (this *UdpActiveStatsPack) Read(din *io.DataInputX)

func (*UdpActiveStatsPack) ToString

func (this *UdpActiveStatsPack) ToString() string

func (*UdpActiveStatsPack) Write

func (this *UdpActiveStatsPack) Write(dout *io.DataOutputX)

type UdpConfigPack

type UdpConfigPack struct {
	AbstractPack
	Data    string
	MapData map[string]string
}

func NewUdpConfigPack

func NewUdpConfigPack() *UdpConfigPack

func NewUdpConfigPackVer

func NewUdpConfigPackVer(ver int32) *UdpConfigPack

func (*UdpConfigPack) Clear

func (this *UdpConfigPack) Clear()

func (*UdpConfigPack) GetPackType

func (this *UdpConfigPack) GetPackType() uint8

func (*UdpConfigPack) Process

func (this *UdpConfigPack) Process()

func (*UdpConfigPack) Read

func (this *UdpConfigPack) Read(din *io.DataInputX)

func (*UdpConfigPack) Set

func (this *UdpConfigPack) Set(m map[string]string)

func (*UdpConfigPack) ToString

func (this *UdpConfigPack) ToString() string

func (*UdpConfigPack) Write

func (this *UdpConfigPack) Write(dout *io.DataOutputX)

type UdpDBConPoolPack

type UdpDBConPoolPack struct {
	AbstractPack
	Data     string
	Pid      int32
	Url      string
	ActCnt   int32
	InactCnt int32
}

func NewUdpDBConPoolPack

func NewUdpDBConPoolPack() *UdpDBConPoolPack

func NewUdpDBConPoolPackVer

func NewUdpDBConPoolPackVer(ver int32) *UdpDBConPoolPack

func (*UdpDBConPoolPack) Clear

func (this *UdpDBConPoolPack) Clear()

func (*UdpDBConPoolPack) GetPackType

func (this *UdpDBConPoolPack) GetPackType() uint8

func (*UdpDBConPoolPack) Process

func (this *UdpDBConPoolPack) Process()

func (*UdpDBConPoolPack) Read

func (this *UdpDBConPoolPack) Read(din *io.DataInputX)

func (*UdpDBConPoolPack) ToString

func (this *UdpDBConPoolPack) ToString() string

func (*UdpDBConPoolPack) Write

func (this *UdpDBConPoolPack) Write(dout *io.DataOutputX)

type UdpPack

type UdpPack interface {
	GetPackType() uint8
	Write(out *io.DataOutputX)
	Read(in *io.DataInputX)

	SetVersion(ver int32)
	GetVersion() int32

	SetFlush(flush bool)
	IsFlush() bool

	// Processing data
	Process()

	Clear()
}

func CreatePack

func CreatePack(t uint8, ver int32) UdpPack

func ReadPack

func ReadPack(t uint8, ver int32, in *io.DataInputX) UdpPack

func ToPack

func ToPack(t uint8, ver int32, b []byte) UdpPack

type UdpRelayPack

type UdpRelayPack struct {
	AbstractPack
	RelayType int16
	Len       int32
	Data      []byte
}

func NewUdpRelayPack

func NewUdpRelayPack() *UdpRelayPack

func NewUdpRelayPackVer

func NewUdpRelayPackVer(ver int32) *UdpRelayPack

func (*UdpRelayPack) Clear

func (this *UdpRelayPack) Clear()

func (*UdpRelayPack) GetPackType

func (this *UdpRelayPack) GetPackType() uint8

func (*UdpRelayPack) Process

func (this *UdpRelayPack) Process()

func (*UdpRelayPack) Read

func (this *UdpRelayPack) Read(din *io.DataInputX)

func (*UdpRelayPack) ToString

func (this *UdpRelayPack) ToString() string

func (*UdpRelayPack) Write

func (this *UdpRelayPack) Write(dout *io.DataOutputX)

type UdpTxDbcPack

type UdpTxDbcPack struct {
	AbstractPack
	Dbc string
	//error
	ErrorType    string
	ErrorMessage string

	Stack string
}

func NewUdpTxDbcPack

func NewUdpTxDbcPack() *UdpTxDbcPack

func NewUdpTxDbcPackVer

func NewUdpTxDbcPackVer(ver int32) *UdpTxDbcPack

func (*UdpTxDbcPack) Clear

func (this *UdpTxDbcPack) Clear()

func (*UdpTxDbcPack) GetPackType

func (this *UdpTxDbcPack) GetPackType() uint8

func (*UdpTxDbcPack) Process

func (this *UdpTxDbcPack) Process()

func (*UdpTxDbcPack) Read

func (this *UdpTxDbcPack) Read(din *io.DataInputX)

func (*UdpTxDbcPack) ToString

func (this *UdpTxDbcPack) ToString() string

func (*UdpTxDbcPack) Write

func (this *UdpTxDbcPack) Write(dout *io.DataOutputX)

type UdpTxEndPack

type UdpTxEndPack struct {
	AbstractPack

	// Pack
	Host    string
	Uri     string
	Mtid    int64
	Mdepth  int32
	Mcaller int64

	McallerTxid    int64
	McallerPcode   int64
	McallerSpec    string
	McallerUrl     string
	McallerPoidKey string

	Status int32

	// Processing data
	ServiceURL     *urlutil.URL
	McallerUrlHash int32
}

func NewUdpTxEndPack

func NewUdpTxEndPack() *UdpTxEndPack

func NewUdpTxEndPackVer

func NewUdpTxEndPackVer(ver int32) *UdpTxEndPack

func (*UdpTxEndPack) Clear

func (this *UdpTxEndPack) Clear()

func (*UdpTxEndPack) GetPackType

func (this *UdpTxEndPack) GetPackType() uint8

func (*UdpTxEndPack) Process

func (this *UdpTxEndPack) Process()

func (*UdpTxEndPack) Read

func (this *UdpTxEndPack) Read(din *io.DataInputX)

func (*UdpTxEndPack) SetMcallerUrlHash

func (this *UdpTxEndPack) SetMcallerUrlHash(v int32)

func (*UdpTxEndPack) ToString

func (this *UdpTxEndPack) ToString() string

func (*UdpTxEndPack) Write

func (this *UdpTxEndPack) Write(dout *io.DataOutputX)

type UdpTxErrorPack

type UdpTxErrorPack struct {
	AbstractPack
	ErrorType    string
	ErrorMessage string
	Stack        string
}

func NewUdpTxErrorPack

func NewUdpTxErrorPack() *UdpTxErrorPack

func NewUdpTxErrorPackVer

func NewUdpTxErrorPackVer(ver int32) *UdpTxErrorPack

func (*UdpTxErrorPack) Clear

func (this *UdpTxErrorPack) Clear()

func (*UdpTxErrorPack) GetPackType

func (this *UdpTxErrorPack) GetPackType() uint8

func (*UdpTxErrorPack) Process

func (this *UdpTxErrorPack) Process()

func (*UdpTxErrorPack) Read

func (this *UdpTxErrorPack) Read(din *io.DataInputX)

func (*UdpTxErrorPack) ToString

func (this *UdpTxErrorPack) ToString() string

func (*UdpTxErrorPack) Write

func (this *UdpTxErrorPack) Write(dout *io.DataOutputX)

type UdpTxHttpcPack

type UdpTxHttpcPack struct {
	AbstractPack
	// Pack
	Url          string
	Mcallee      int64
	ErrorType    string
	ErrorMessage string
	Stack        string

	//Processing data
	HttpcURL *urlutil.URL
}

func NewUdpTxHttpcPack

func NewUdpTxHttpcPack() *UdpTxHttpcPack

func NewUdpTxHttpcPackVer

func NewUdpTxHttpcPackVer(ver int32) *UdpTxHttpcPack

func (*UdpTxHttpcPack) Clear

func (this *UdpTxHttpcPack) Clear()

func (*UdpTxHttpcPack) GetPackType

func (this *UdpTxHttpcPack) GetPackType() uint8

func (*UdpTxHttpcPack) Process

func (this *UdpTxHttpcPack) Process()

func (*UdpTxHttpcPack) Read

func (this *UdpTxHttpcPack) Read(din *io.DataInputX)

func (*UdpTxHttpcPack) ToString

func (this *UdpTxHttpcPack) ToString() string

func (*UdpTxHttpcPack) Write

func (this *UdpTxHttpcPack) Write(dout *io.DataOutputX)

type UdpTxMessagePack

type UdpTxMessagePack struct {
	AbstractPack
	Hash  string
	Value string
	Desc  string
}

func NewUdpTxMessagePack

func NewUdpTxMessagePack() *UdpTxMessagePack

func NewUdpTxMessagePackVer

func NewUdpTxMessagePackVer(ver int32) *UdpTxMessagePack

func (*UdpTxMessagePack) Clear

func (this *UdpTxMessagePack) Clear()

func (*UdpTxMessagePack) GetPackType

func (this *UdpTxMessagePack) GetPackType() uint8

func (*UdpTxMessagePack) Process

func (this *UdpTxMessagePack) Process()

func (*UdpTxMessagePack) Read

func (this *UdpTxMessagePack) Read(din *io.DataInputX)

func (*UdpTxMessagePack) SetHeader

func (this *UdpTxMessagePack) SetHeader(m map[string][]string)

func (*UdpTxMessagePack) ToString

func (this *UdpTxMessagePack) ToString() string

func (*UdpTxMessagePack) Write

func (this *UdpTxMessagePack) Write(dout *io.DataOutputX)

type UdpTxMethodPack

type UdpTxMethodPack struct {
	AbstractPack
	Method string
	Stack  string
}

func NewUdpTxMethodPack

func NewUdpTxMethodPack() *UdpTxMethodPack

func NewUdpTxMethodPackVer

func NewUdpTxMethodPackVer(ver int32) *UdpTxMethodPack

func (*UdpTxMethodPack) Clear

func (this *UdpTxMethodPack) Clear()

func (*UdpTxMethodPack) GetPackType

func (this *UdpTxMethodPack) GetPackType() uint8

func (*UdpTxMethodPack) Process

func (this *UdpTxMethodPack) Process()

func (*UdpTxMethodPack) Read

func (this *UdpTxMethodPack) Read(din *io.DataInputX)

func (*UdpTxMethodPack) ToString

func (this *UdpTxMethodPack) ToString() string

func (*UdpTxMethodPack) Write

func (this *UdpTxMethodPack) Write(dout *io.DataOutputX)

type UdpTxParamPack

type UdpTxParamPack struct {
	AbstractPack
	ParamId       string
	ParamResponse string
	Data          string
	StrDatas      []string
	ParamPack     *pack.ParamPack
}

func NewUdpTxParamPack

func NewUdpTxParamPack() *UdpTxParamPack

func NewUdpTxParamPackVer

func NewUdpTxParamPackVer(ver int32) *UdpTxParamPack

func (*UdpTxParamPack) Clear

func (this *UdpTxParamPack) Clear()

func (*UdpTxParamPack) GetPackType

func (this *UdpTxParamPack) GetPackType() uint8

func (*UdpTxParamPack) Process

func (this *UdpTxParamPack) Process()

func (*UdpTxParamPack) Read

func (this *UdpTxParamPack) Read(din *io.DataInputX)

func (*UdpTxParamPack) ToString

func (this *UdpTxParamPack) ToString() string

func (*UdpTxParamPack) Write

func (this *UdpTxParamPack) Write(dout *io.DataOutputX)

type UdpTxSecureMessagePack

type UdpTxSecureMessagePack struct {
	AbstractPack
	Hash  string
	Value string
	Desc  string
}

func NewUdpTxSecureMessagePack

func NewUdpTxSecureMessagePack() *UdpTxSecureMessagePack

func NewUdpTxSecureMessagePackVer

func NewUdpTxSecureMessagePackVer(ver int32) *UdpTxSecureMessagePack

func (*UdpTxSecureMessagePack) Clear

func (this *UdpTxSecureMessagePack) Clear()

func (*UdpTxSecureMessagePack) GetPackType

func (this *UdpTxSecureMessagePack) GetPackType() uint8

func (*UdpTxSecureMessagePack) Process

func (this *UdpTxSecureMessagePack) Process()

func (*UdpTxSecureMessagePack) Read

func (this *UdpTxSecureMessagePack) Read(din *io.DataInputX)

func (*UdpTxSecureMessagePack) SetParameter

func (this *UdpTxSecureMessagePack) SetParameter(m map[string][]string)

func (*UdpTxSecureMessagePack) ToString

func (this *UdpTxSecureMessagePack) ToString() string

func (*UdpTxSecureMessagePack) Write

func (this *UdpTxSecureMessagePack) Write(dout *io.DataOutputX)

type UdpTxSqlPack

type UdpTxSqlPack struct {
	AbstractPack
	Dbc string
	Sql string
	//error
	ErrorType    string
	ErrorMessage string

	Stack string
}

func NewUdpTxSqlPack

func NewUdpTxSqlPack() *UdpTxSqlPack

func NewUdpTxSqlPackVer

func NewUdpTxSqlPackVer(ver int32) *UdpTxSqlPack

func (*UdpTxSqlPack) Clear

func (this *UdpTxSqlPack) Clear()

func (*UdpTxSqlPack) GetPackType

func (this *UdpTxSqlPack) GetPackType() uint8

func (*UdpTxSqlPack) Process

func (this *UdpTxSqlPack) Process()

func (*UdpTxSqlPack) Read

func (this *UdpTxSqlPack) Read(din *io.DataInputX)

func (*UdpTxSqlPack) ToString

func (this *UdpTxSqlPack) ToString() string

func (*UdpTxSqlPack) Write

func (this *UdpTxSqlPack) Write(dout *io.DataOutputX)

type UdpTxSqlParamPack

type UdpTxSqlParamPack struct {
	AbstractPack
	Dbc   string
	Sql   string
	Param string
	//error
	ErrorType    string
	ErrorMessage string

	Stack string
}

func NewUdpTxSqlParamPack

func NewUdpTxSqlParamPack() *UdpTxSqlParamPack

func NewUdpTxSqlParamPackVer

func NewUdpTxSqlParamPackVer(ver int32) *UdpTxSqlParamPack

func (*UdpTxSqlParamPack) Clear

func (this *UdpTxSqlParamPack) Clear()

func (*UdpTxSqlParamPack) GetPackType

func (this *UdpTxSqlParamPack) GetPackType() uint8

func (*UdpTxSqlParamPack) Process

func (this *UdpTxSqlParamPack) Process()

func (*UdpTxSqlParamPack) Read

func (this *UdpTxSqlParamPack) Read(din *io.DataInputX)

func (*UdpTxSqlParamPack) ToString

func (this *UdpTxSqlParamPack) ToString() string

func (*UdpTxSqlParamPack) Write

func (this *UdpTxSqlParamPack) Write(dout *io.DataOutputX)

type UdpTxStartEndPack

type UdpTxStartEndPack struct {
	AbstractPack
	// Pack
	Host             string
	Uri              string
	Ipaddr           string
	UAgent           string
	Ref              string
	WClientId        string
	HttpMethod       string
	IsStaticContents string

	Mtid    int64
	Mdepth  int32
	Mcaller int64

	McallerTxid    int64
	McallerPcode   int64
	McallerSpec    string
	McallerUrl     string
	McallerPoidKey string

	//Processing data
	ServiceURL     *urlutil.URL
	RefererURL     *urlutil.URL
	IsStatic       bool
	McallerUrlHash int32
}

func NewUdpTxStartEndPack

func NewUdpTxStartEndPack() *UdpTxStartEndPack

func NewUdpTxStartEndPackVer

func NewUdpTxStartEndPackVer(ver int32) *UdpTxStartEndPack

func (*UdpTxStartEndPack) Clear

func (this *UdpTxStartEndPack) Clear()

func (*UdpTxStartEndPack) GetPackType

func (this *UdpTxStartEndPack) GetPackType() uint8

func (*UdpTxStartEndPack) Process

func (this *UdpTxStartEndPack) Process()

func (*UdpTxStartEndPack) Read

func (this *UdpTxStartEndPack) Read(din *io.DataInputX)

func (*UdpTxStartEndPack) SetStaticContents

func (this *UdpTxStartEndPack) SetStaticContents(b bool)

func (*UdpTxStartEndPack) ToString

func (this *UdpTxStartEndPack) ToString() string

func (*UdpTxStartEndPack) Write

func (this *UdpTxStartEndPack) Write(dout *io.DataOutputX)

type UdpTxStartPack

type UdpTxStartPack struct {
	AbstractPack
	// Pack
	Host             string
	Uri              string
	Ipaddr           string
	UAgent           string
	Ref              string
	WClientId        string
	HttpMethod       string
	IsStaticContents string

	//Processing data
	ServiceURL *urlutil.URL
	RefererURL *urlutil.URL
	IsStatic   bool
}

func NewUdpTxStartPack

func NewUdpTxStartPack() *UdpTxStartPack

func NewUdpTxStartPackVer

func NewUdpTxStartPackVer(ver int32) *UdpTxStartPack

func (*UdpTxStartPack) Clear

func (this *UdpTxStartPack) Clear()

func (*UdpTxStartPack) GetPackType

func (this *UdpTxStartPack) GetPackType() uint8

func (*UdpTxStartPack) Process

func (this *UdpTxStartPack) Process()

func (*UdpTxStartPack) Read

func (this *UdpTxStartPack) Read(din *io.DataInputX)

func (*UdpTxStartPack) SetStaticContents

func (this *UdpTxStartPack) SetStaticContents(b bool)

func (*UdpTxStartPack) ToString

func (this *UdpTxStartPack) ToString() string

func (*UdpTxStartPack) Write

func (this *UdpTxStartPack) Write(dout *io.DataOutputX)

Jump to

Keyboard shortcuts

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