Documentation ¶
Index ¶
- Constants
- func CloneHeaders(h1 map[string]string, h2 map[string]string) map[string]string
- func ColorString(text string) string
- func EncodeHeaders(headers http.Header) string
- func GetStructTags(i interface{}) []string
- func LoadUserData(file string) (string, error)
- func LogError(err error, message string, exit bool)
- func RaiseIfError(err error, msg string)
- func ReadResponseBody(resp *http.Response) string
- func UnmarshalResponse(resp *http.Response, o interface{}) error
- func UrlJoin(path ...string) string
- func UrlValues(m map[string]string) url.Values
- func VersionUrl(endpoint, version string) string
- type BaseResponse
- type ColorFormater
- type HttpError
- type ReaderWithProcess
- type Request
- type Response
- func (resp Response) BodyString() string
- func (resp Response) BodyUnmarshal(object interface{}) error
- func (resp Response) GetContentLength() int
- func (resp Response) GetHeader(key string) string
- func (resp Response) IsNotFound() bool
- func (resp *Response) JudgeStatus() error
- func (resp *Response) ReadAll() error
- func (resp Response) SaveBody(file *os.File, process bool) error
- func (resp *Response) SetBodyReader(reader io.ReadCloser)
- type RestfulClient
- func (c RestfulClient) Delete(url string, headers map[string]string) (*Response, error)
- func (c RestfulClient) Get(url string, query url.Values, headers map[string]string) (*Response, error)
- func (c RestfulClient) Post(url string, body []byte, headers map[string]string) (*Response, error)
- func (c RestfulClient) Put(url string, body []byte, headers map[string]string) (*Response, error)
- func (c RestfulClient) Request(req *http.Request) (*Response, error)
- type Session
- type StringRing
Constants ¶
View Source
const (
CODE_404 = 404
)
Variables ¶
This section is empty.
Functions ¶
func ColorString ¶
func EncodeHeaders ¶
func GetStructTags ¶
func GetStructTags(i interface{}) []string
func LoadUserData ¶
func RaiseIfError ¶
func ReadResponseBody ¶
func UnmarshalResponse ¶
func VersionUrl ¶
Types ¶
type BaseResponse ¶
type BaseResponse interface { BodyString() GetHeader() BodyUnmarshal(object interface{}) }
type ColorFormater ¶
var BaseColorFormatter ColorFormater
func (ColorFormater) Format ¶
func (cf ColorFormater) Format(text string) string
type HttpError ¶
func (HttpError) IsNotFound ¶
type ReaderWithProcess ¶
func NewProcessReader ¶
func NewProcessReader(reader io.ReadCloser, size int) *ReaderWithProcess
type Response ¶
type Response struct { Status int Reason string Body []byte Headers http.Header // contains filtered or unexported fields }
func (Response) BodyString ¶
func (Response) BodyUnmarshal ¶
func (Response) GetContentLength ¶
func (Response) IsNotFound ¶
func (*Response) JudgeStatus ¶
func (*Response) SetBodyReader ¶
func (resp *Response) SetBodyReader(reader io.ReadCloser)
type RestfulClient ¶
type StringRing ¶
type StringRing struct { Items []string // contains filtered or unexported fields }
func (*StringRing) Next ¶
func (r *StringRing) Next() string
func (*StringRing) Sample ¶
func (r *StringRing) Sample(count int) []string
Click to show internal directories.
Click to hide internal directories.