Documentation ¶
Overview ¶
Author:
Carlos Timoshenko carlostimoshenkorodrigueslopes@gmail.com https://github.com/softctrl
This project is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
Author:
Carlos Timoshenko carlostimoshenkorodrigueslopes@gmail.com https://github.com/softctrl
This project is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
Index ¶
- Constants
- Variables
- func Delete(__url string) ([]byte, error)
- func Get(__url string) ([]byte, error)
- func Perform(__command Method, __url string, __body []byte, __header http.Header) (string, int, []byte, error)
- func Post(__url string) ([]byte, error)
- func PostBody(__url string, __body []byte) ([]byte, error)
- func PostForm(__url string, __body url.Values) ([]byte, error)
- func Put(__url string) ([]byte, error)
- type Method
- type Methods
- type StatusCode
- type StatusCodeRange
Constants ¶
const ( GET = Method(http.MethodGet) HEAD = Method(http.MethodHead) POST = Method(http.MethodPost) PUT = Method(http.MethodPut) PATCH = Method(http.MethodPatch) DELETE = Method(http.MethodDelete) CONNECT = Method(http.MethodConnect) OPTIONS = Method(http.MethodOptions) TRACE = Method(http.MethodTrace) )
Common HTTP methods.
Unless otherwise noted, these are defined in RFC 7231 section 4.3.
const DEFAULT_TIMEOUT = time.Second * 200
Variables ¶
var HTTP_100 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_101 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_102 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_103 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_1xx = StatusCodeRange{/* contains filtered or unexported fields */}
var HTTP_200 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_201 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_202 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_203 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_204 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_205 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_206 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_207 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_208 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_226 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_2xx = StatusCodeRange{/* contains filtered or unexported fields */}
var HTTP_300 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_301 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_302 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_303 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_304 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_305 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_306 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_307 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_308 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_3xx = StatusCodeRange{/* contains filtered or unexported fields */}
var HTTP_400 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_401 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_402 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_403 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_404 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_405 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_406 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_407 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_408 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_409 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_410 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_411 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_412 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_413 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_414 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_415 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_416 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_417 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_421 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_422 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_423 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_424 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_426 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_428 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_429 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_431 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_451 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_4xx = StatusCodeRange{/* contains filtered or unexported fields */}
var HTTP_500 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_501 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_502 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_503 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_504 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_505 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_506 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_507 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_508 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_510 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_511 = StatusCode{/* contains filtered or unexported fields */}
var HTTP_5xx = StatusCodeRange{/* contains filtered or unexported fields */}
Functions ¶
func Perform ¶
func Perform(__command Method, __url string, __body []byte, __header http.Header) (string, int, []byte, error)
Generic HTTP perform method.
Types ¶
type Method ¶
type Method string
func MethodFromString ¶
MethodFromString returns a Method instance from an informed string.
type StatusCode ¶
type StatusCode struct {
// contains filtered or unexported fields
}
Based on: http://www.iana.org/assignments/http-status-codes
func (*StatusCode) Code ¶
func (__obj *StatusCode) Code() int
func (*StatusCode) Desc ¶
func (__obj *StatusCode) Desc() string
func (*StatusCode) RFC ¶
func (__obj *StatusCode) RFC() string
type StatusCodeRange ¶
type StatusCodeRange struct {
// contains filtered or unexported fields
}
func StatusCodeRangeFromString ¶
func StatusCodeRangeFromString(__value string) *StatusCodeRange
func (*StatusCodeRange) Desc ¶
func (__obj *StatusCodeRange) Desc() string
func (*StatusCodeRange) Max ¶
func (__obj *StatusCodeRange) Max() int
func (*StatusCodeRange) Min ¶
func (__obj *StatusCodeRange) Min() int
func (*StatusCodeRange) RFC ¶
func (__obj *StatusCodeRange) RFC() string