Documentation
¶
Index ¶
- func App(r *http.Request) string
- func Delete(url string, header et.Json) (*Body, Status)
- func DeleteWithTls(url string, header et.Json, tlsConfig *tls.Config) (*Body, Status)
- func Device(r *http.Request) string
- func Fetch(method, url string, header, body et.Json) (*Body, Status)
- func Get(url string, header et.Json) (*Body, Status)
- func GetWithTls(url string, header et.Json, tlsConfig *tls.Config) (*Body, Status)
- func Http(method, url string, header, body et.Json, tlsConfig *tls.Config) (*Body, Status)
- func NewTlsConfig(caFile, certFile, keyFile string) (*tls.Config, error)
- func Options(url string, header et.Json) (*Body, Status)
- func OptionsWithTls(url string, header et.Json, tlsConfig *tls.Config) (*Body, Status)
- func Patch(url string, header, body et.Json) (*Body, Status)
- func PatchWithTls(url string, header, body et.Json, tlsConfig *tls.Config) (*Body, Status)
- func Payload(r *http.Request) et.Json
- func Post(url string, header, body et.Json) (*Body, Status)
- func PostWithTls(url string, header, body et.Json, tlsConfig *tls.Config) (*Body, Status)
- func Put(url string, header, body et.Json) (*Body, Status)
- func PutWithTls(url string, header, body et.Json, tlsConfig *tls.Config) (*Body, Status)
- func ServiceId(r *http.Request) string
- func Username(r *http.Request) string
- type Body
- func (b Body) ToArrayJson() ([]et.Json, error)
- func (b Body) ToBool() (bool, error)
- func (b Body) ToFloat() (float64, error)
- func (b Body) ToInt() (int, error)
- func (b Body) ToInt64() (int64, error)
- func (b Body) ToItem() (et.Item, error)
- func (b Body) ToItems() (et.Items, error)
- func (b Body) ToJson() (et.Json, error)
- func (b Body) ToString() string
- func (b Body) ToTime() (time.Time, error)
- type ContextKey
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteWithTls ¶ added in v0.1.19
* * DeleteWithTls * @param url string, header et.Json, tlsConfig *tls.Config * @return *Body, Status *
func Fetch ¶ added in v0.1.17
* * Fetch * @param method, url string, header, body et.Json * @return *Body, Status *
func GetWithTls ¶ added in v0.1.19
* * GetWithTls * @param url string, header et.Json, tlsConfig *tls.Config * @return *Body, Status *
func Http ¶ added in v0.1.19
* * Http * @param method, url string, header, body et.Json * @return *Body, Status *
func NewTlsConfig ¶ added in v0.1.18
* * NewTlsConfig * @param caPath, certPath, keyPath string * @return *tls.Config, error *
func OptionsWithTls ¶ added in v0.1.19
* * OptionsWithTls * @param url string, header et.Json, tlsConfig *tls.Config * @return *Body, Status *
func PatchWithTls ¶ added in v0.1.19
* * PatchWithCA * @param url string, header, body et.Json, tlsConfig *tls.Config * @return *Body, Status *
func PostWithTls ¶ added in v0.1.19
* * PostWithTls * @param url string, header, body et.Json, tlsConfig *tls.Config * @return *Body, Status *
func PutWithTls ¶ added in v0.1.19
* * PutWithTls * @param url string, header, body et.Json, tlsConfig *tls.Config * @return *Body, Status *
Types ¶
type Body ¶
type Body struct {
Data []byte
}
* * Body struct to convert the body response *
func ReadBody ¶
func ReadBody(body io.ReadCloser) (*Body, error)
* * ReadBody reads the body response * @param body io.ReadCloser * @return *Body, error *
func (Body) ToArrayJson ¶
* * ToArrayJson returns a Json array object * @return []et.Json *
type ContextKey ¶ added in v1.0.12
type ContextKey string
const ( DurationKey ContextKey = "duration" PayloadKey ContextKey = "payload" ServiceIdKey ContextKey = "service_id" AppKey ContextKey = "app" DeviceKey ContextKey = "device" UsernameKey ContextKey = "username" )
func (ContextKey) Duration ¶ added in v1.0.12
* * Duration * @param ctx context.Context, def time.Duration * @return time.Duration *