client

package
v0.0.0-...-9bf734b Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesCBCDecrypt

func AesCBCDecrypt(encrypted_body []byte, key []byte, iv []byte) []byte

aes cbc解密

func AesCBCEncrypt

func AesCBCEncrypt(body []byte, key []byte, iv []byte) []byte

aes cbc加密

func AesFTECBDecrypt

func AesFTECBDecrypt(encrypted_body []byte, key []byte) []byte

aes FT ECB 解密

func AesFTECBEncrypt

func AesFTECBEncrypt(body []byte, key []byte) []byte

aes FT ECB 加密

func DefaultCallback

func DefaultCallback(p *ResPack)

func PKCS7Padding

func PKCS7Padding(ciphertext []byte, blockSize int) []byte

PKCS7 填充模式

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) ([]byte, error)

填充的反向操作,删除填充字符串

func RsaDecrypt

func RsaDecrypt(encrypted_body []byte, key []byte) []byte

func RsaEncrypt

func RsaEncrypt(body []byte, key []byte) []byte

Types

type Client

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

func Create

func Create(host string, rsa_file string, notify bool) (*Client, error)

func EncryptNew

func EncryptNew(host string, rsa_file string) (*Client, error)

func New

func New(host string) (*Client, error)

func (*Client) Async

func (c *Client) Async(protoID uint32, dopts ...adapt.Option) error

func (*Client) Close

func (c *Client) Close()

func (*Client) GetEncrypt

func (c *Client) GetEncrypt() bool

func (*Client) Init

func (c *Client) Init() error

func (*Client) KeepAlive

func (c *Client) KeepAlive()

func (*Client) OK

func (c *Client) OK() bool

func (*Client) ProtoWtite

func (c *Client) ProtoWtite(protoID uint32, dopts ...adapt.Option) (uint32, error)

写一次

func (*Client) Read

func (c *Client) Read() *ResPack

func (*Client) Sync

func (c *Client) Sync(protoID uint32, dopts ...adapt.Option) adapt.Response

type ResPack

type ResPack struct {
	Header   *adapt.Header
	Response *adapt.Response
}

type Worker

type Worker struct {
	OpenQuoteHand   bool
	OpenTradeHand   bool
	OpenSysHand     bool
	OpenDefaultHand bool
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker() *Worker

func (*Worker) PrepareClient

func (w *Worker) PrepareClient(cb func() *Client)

func (*Worker) Read

func (w *Worker) Read()

func (*Worker) SetDefaultHandle

func (w *Worker) SetDefaultHandle(cb func(*ResPack))

func (*Worker) SetQuoteNotifyHandle

func (w *Worker) SetQuoteNotifyHandle(cb func(*ResPack))

func (*Worker) SetSysNotifyHandle

func (w *Worker) SetSysNotifyHandle(cb func(*ResPack))

func (*Worker) SetTrdNotifyHandle

func (w *Worker) SetTrdNotifyHandle(cb func(*ResPack))

func (*Worker) Work

func (w *Worker) Work()

Jump to

Keyboard shortcuts

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