highway

package
v0.0.0-...-d9311aa Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceMethodEcho   = "PicUp.Echo"
	ServiceMethodUpload = "PicUp.DataUp"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Args

type Args struct {
	Uin           int64                         `json:"uin,omitempty"`
	Seq           int32                         `json:"seq,omitempty"`
	ServiceMethod string                        `json:"service_method,omitempty"`
	CommandID     int32                         `json:"command_id,omitempty"`
	SegHead       *pb.CSDataHighwayHead_SegHead `json:"seg_head,omitempty"`
	Payload       []byte                        `json:"-"`
}

type Call

type Call struct {
	ServiceMethod string
	Seq           int32
	Args          *Args
	Reply         *Reply
	Error         error
	Done          chan *Call
}

type Client

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

func Dial

func Dial(network, address string) (*Client, error)

func NewClient

func NewClient(conn io.ReadWriteCloser) *Client

func (*Client) Call

func (c *Client) Call(serviceMethod string, args *Args, reply *Reply) error

func (*Client) Close

func (c *Client) Close() error

func (*Client) Go

func (c *Client) Go(serviceMethod string, args *Args, reply *Reply, done chan *Call) *Call

func (*Client) UploadFile

func (c *Client) UploadFile(uin int64, cmd int32, name string, ticket []byte) error

func (*Client) UploadReadSeeker

func (c *Client) UploadReadSeeker(uin int64, cmd int32, r io.ReadSeeker, ticket []byte) error

func (*Client) UploadReader

func (c *Client) UploadReader(uin int64, cmd int32, size int64, r io.Reader, digest, ticket []byte) error

type Codec

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

func NewCodec

func NewCodec(conn io.ReadWriteCloser) *Codec

func (*Codec) Close

func (c *Codec) Close() error

func (*Codec) ReadResponseBody

func (c *Codec) ReadResponseBody(reply *Reply) (err error)

func (*Codec) ReadResponseHeader

func (c *Codec) ReadResponseHeader(resp *Response) (err error)

func (*Codec) WriteRequest

func (c *Codec) WriteRequest(req *Request, args *Args) error

type Reply

type Reply struct {
	Uin           int64  `json:"uin,omitempty"`
	Seq           int32  `json:"seq,omitempty"`
	Code          int32  `json:"code,omitempty"`
	ServiceMethod string `json:"service_method,omitempty"`
	Payload       []byte `json:"-"`
}

type Request

type Request struct {
	Username      string `json:"username,omitempty"`
	Seq           int32  `json:"seq,omitempty"`
	ServiceMethod string `json:"service_method,omitempty"`
	CommandID     int32  `json:"command_id,omitempty"`
	AppID         int32  `json:"app_id,omitempty"`
}

type Response

type Response struct {
	Username      string `json:"username,omitempty"`
	Seq           int32  `json:"seq,omitempty"`
	ServiceMethod string `json:"service_method,omitempty"`
	Code          int32  `json:"code,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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