model

package
v0.0.0-...-4c075ac Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package model SDK models

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseResponse

type BaseResponse struct {
	Header ResponseHeader  `json:"header"`
	Body   json.RawMessage `json:"body"`
}

BaseResponse shared response data struct

func (BaseResponse) Error

func (r BaseResponse) Error() string

Error implement error interface

func (BaseResponse) IsError

func (r BaseResponse) IsError() bool

IsError detect if the response is an error

type GetRequest

type GetRequest interface {
	Url() string
	Encode() string
}

GetRequest request interface for get

type Header struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Token    string `json:"token"`
}

type HeaderTarget

type HeaderTarget struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Token    string `json:"token"`
	Target   string `json:"target"`
}

type PageInfo

type PageInfo struct {
	TotalCount int `json:"totalCount"`
}

type PostRequest

type PostRequest interface {
	Url() string
	Encode() []byte
}

PostRequest request interface for post

type Response

type Response interface {
	IsError() bool
	Error() string
}

Response api response interface

type ResponseHeader

type ResponseHeader struct {
	Desc      string `json:"desc"`
	Status    uint   `json:"status"`
	Quota     int    `json:"quota"`
	LeftQuota int    `json:"left_quota"`
}

type UploadField

type UploadField struct {
	// Key field key
	Key string
	// Value field value
	Value string
	// Reader upload file reader
	Reader io.Reader
}

UploadField multipart/form-data post request field struct

type UploadRequest

type UploadRequest interface {
	Url() string
	// Encode encode request to UploadFields
	Encode() []UploadField
}

UploadRequest multipart/form-data reqeust interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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