Documentation ¶
Index ¶
- type AddFileRawData
- type Error
- type Request
- type RequestBuilder
- func (r *RequestBuilder) Arguments(args ...string) *RequestBuilder
- func (r *RequestBuilder) Body(body io.Reader) *RequestBuilder
- func (r *RequestBuilder) BodyBytes(body []byte) *RequestBuilder
- func (r *RequestBuilder) BodyString(body string) *RequestBuilder
- func (r *RequestBuilder) Exec(ctx context.Context, res interface{}) error
- func (r *RequestBuilder) Header(name, value string) *RequestBuilder
- func (r *RequestBuilder) Option(key string, value interface{}) *RequestBuilder
- func (r *RequestBuilder) Send(ctx context.Context) (*Response, error)
- func (r *RequestBuilder) SetMethod(method string) *RequestBuilder
- type Response
- type Shell
- func (s *Shell) AddFile(requestUser, filePath string) (SoterResponse, error)
- func (s *Shell) Autopay(enable bool) (SoterResponse, error)
- func (s *Shell) Balance() (SoterResponse, error)
- func (s *Shell) EditProfile(email, phoneNumber string) (SoterResponse, error)
- func (s *Shell) QueryDepositHistory(start, end int64, offset, limit int32) (SoterResponse, error)
- func (s *Shell) QueryFileList(start, end int64, offset, limit int32, deleted bool) (SoterResponse, error)
- func (s *Shell) QueryOrderDetails(requestId string) (SoterResponse, error)
- func (s *Shell) QueryOrderList(start, end int64, offset, limit int32) (SoterResponse, error)
- func (s *Shell) QueryProfile() (SoterResponse, error)
- func (s *Shell) Request(command string, args ...string) *RequestBuilder
- func (s *Shell) SetTimeout(d time.Duration)
- type SoterOpts
- type SoterResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddFileRawData ¶
type Request ¶
type Request struct { Ctx context.Context ApiBase string Command string Args []string Opts map[string]string Body io.Reader Headers map[string]string Method string }
func NewRequest ¶
type RequestBuilder ¶
type RequestBuilder struct {
// contains filtered or unexported fields
}
RequestBuilder is an commands request builder.
func (*RequestBuilder) Arguments ¶
func (r *RequestBuilder) Arguments(args ...string) *RequestBuilder
Arguments adds the arguments to the args.
func (*RequestBuilder) Body ¶
func (r *RequestBuilder) Body(body io.Reader) *RequestBuilder
Body sets the request body to the given reader.
func (*RequestBuilder) BodyBytes ¶
func (r *RequestBuilder) BodyBytes(body []byte) *RequestBuilder
BodyBytes sets the request body to the given buffer.
func (*RequestBuilder) BodyString ¶
func (r *RequestBuilder) BodyString(body string) *RequestBuilder
BodyString sets the request body to the given string.
func (*RequestBuilder) Exec ¶
func (r *RequestBuilder) Exec(ctx context.Context, res interface{}) error
Exec sends the request a request and decodes the response.
func (*RequestBuilder) Header ¶
func (r *RequestBuilder) Header(name, value string) *RequestBuilder
Header sets the given header.
func (*RequestBuilder) Option ¶
func (r *RequestBuilder) Option(key string, value interface{}) *RequestBuilder
Option sets the given option.
func (*RequestBuilder) Send ¶
func (r *RequestBuilder) Send(ctx context.Context) (*Response, error)
Send sends the request and return the response.
func (*RequestBuilder) SetMethod ¶
func (r *RequestBuilder) SetMethod(method string) *RequestBuilder
SetMethod sets the https request method, GET/POST
type Response ¶
type Response struct { Output io.ReadCloser Error *Error }
type Shell ¶
type Shell struct {
// contains filtered or unexported fields
}
func NewShellWithClient ¶
func (*Shell) AddFile ¶
func (s *Shell) AddFile(requestUser, filePath string) (SoterResponse, error)
func (*Shell) Balance ¶
func (s *Shell) Balance() (SoterResponse, error)
func (*Shell) EditProfile ¶
func (s *Shell) EditProfile(email, phoneNumber string) (SoterResponse, error)
func (*Shell) QueryDepositHistory ¶
func (s *Shell) QueryDepositHistory(start, end int64, offset, limit int32) (SoterResponse, error)
func (*Shell) QueryFileList ¶
func (*Shell) QueryOrderDetails ¶
func (s *Shell) QueryOrderDetails(requestId string) (SoterResponse, error)
func (*Shell) QueryOrderList ¶
func (s *Shell) QueryOrderList(start, end int64, offset, limit int32) (SoterResponse, error)
func (*Shell) QueryProfile ¶
func (s *Shell) QueryProfile() (SoterResponse, error)
func (*Shell) SetTimeout ¶
type SoterOpts ¶
type SoterOpts = func(*RequestBuilder) error
func RawDataOpts ¶
func SignatureOpts ¶
func UserAddressOpts ¶
type SoterResponse ¶
type SoterResponse struct { Code int `json:"code"` Message string `json:"message"` Data interface{} `json:"data"` }
response
Click to show internal directories.
Click to hide internal directories.