tool

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2022 License: MIT Imports: 18 Imported by: 4

Documentation

Index

Constants

View Source
const BufferSize = 4096

bytes size = 4096 data len 4004=4096-8-60-8-16

View Source
const DelayA = "DelayA"
View Source
const DelayQ = "DelayQ"
View Source
const HandshakeCheckStepA1 = "Hi! What's your Info?"
View Source
const HandshakeCheckStepA2 = "OK! Happy handshake"
View Source
const HandshakeCheckStepQ1 = "Hello! I want to shake hands."
View Source
const HandshakeCheckStepQ2 = "Here it is"
View Source
const PingMsg = "Ping"
View Source
const PongMsg = "Pong"
View Source
const SOpenA = "sOpenA"
View Source
const SOpenQ = "sOpenQ"
View Source
const TaskA = "TaskA"
View Source
const TaskQ = "TaskQ"

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(ciphertext []byte, key []byte) ([]byte, error)

func Encrypt

func Encrypt(plaintext []byte, key []byte) ([]byte, error)

func GetConnBs

func GetConnBs(reader *bufio.Reader) (b []byte, err error)

func MustBase64ToBytes added in v1.2.1

func MustBase64ToBytes(str string) []byte

func MustMarshal

func MustMarshal(body interface{}) []byte

func MustUnmarshal

func MustUnmarshal(b []byte, body interface{})

func MustUnmarshalV2

func MustUnmarshalV2(inBody interface{}, outBody interface{})

func NewId

func NewId(n int) (str string)

func Println

func Println(conn net.Conn, i ...any)

func UnmarshalV2

func UnmarshalV2(inBody interface{}, outBody interface{}) error

Types

type CFCHookConfig added in v1.1.0

type CFCHookConfig struct {
	Ct struct {
		Key  string `json:"Key"`
		Name string `json:"Name"`
		IP   string `json:"IP"`
		Port string `json:"Port"`
	} `json:"Ct"`
	Tcp struct {
		Server []struct {
			Name string `json:"Name"`
			IP   string `json:"IP"`
			Port string `json:"Port"`
		} `json:"Server"`
		Client []struct {
			Name string `json:"Name"`
			IP   string `json:"IP"`
			Port string `json:"Port"`
		} `json:"Client"`
	} `json:"Tcp"`
}

func GetCFCHookConfig added in v1.1.0

func GetCFCHookConfig(path string) *CFCHookConfig

type ConnMsg

type ConnMsg struct {
	Header string
	Code   int
	Data   interface{}
	Id     string
}

type Key

type Key struct {
	// contains filtered or unexported fields
}

func NewKey

func NewKey(key string) Key

func (*Key) Decode

func (k *Key) Decode(i interface{}, data []byte) error

func (*Key) Encode

func (k *Key) Encode(i interface{}) (b [][]byte)

func (*Key) GetMsg

func (k *Key) GetMsg(reader *bufio.Reader) (c ConnMsg, err error)

func (*Key) GetMsgV2

func (k *Key) GetMsgV2(reader *bufio.Reader) (b []byte, err error)

func (*Key) SetMsg

func (k *Key) SetMsg(header, id string, code int, data interface{}) [][]byte

type MashBytes added in v1.2.1

type MashBytes struct {
	Data string `json:"go-CFC-Data"`
}

func MustBytesToBase64 added in v1.2.1

func MustBytesToBase64(b []byte) MashBytes

type OdjAddr

type OdjAddr struct {
	Id   string
	Addr string
}

type OdjClientInfo

type OdjClientInfo struct {
	Name string
}

type OdjIdList

type OdjIdList struct {
	IdList []string
}

type OdjInfo

type OdjInfo struct {
	Id       string
	User     string
	Password string
}

type OdjMsg

type OdjMsg struct {
	Msg string
}

type OdjPing

type OdjPing struct {
	Name   string
	Ping   Ping
	Active bool
}

type OdjSub

type OdjSub struct {
	SrcName string
	DstKey  string
}

type Ping

type Ping struct {
	Ping time.Duration
}

Jump to

Keyboard shortcuts

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