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 Duration(r *http.Request) time.Duration
- func Fetch(method, url string, header, body et.Json) (*Body, Status)
- func Get(url string, header et.Json) (*Body, Status)
- func GetBody(r *http.Request) (et.Json, error)
- func GetStr(r *http.Request) (string, error)
- 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 ProfileId(r *http.Request) string
- 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 SetApp(ctx context.Context, app string) context.Context
- func SetDevice(ctx context.Context, device string) context.Context
- func SetDuration(ctx context.Context, duration time.Duration) context.Context
- func SetPayload(ctx context.Context, payload et.Json) context.Context
- func SetProfileId(ctx context.Context, profileId string) context.Context
- func SetServiceId(ctx context.Context, serviceId string) context.Context
- func SetTenantId(ctx context.Context, tenantId string) context.Context
- func SetUserId(ctx context.Context, userId string) context.Context
- func SetUsername(ctx context.Context, username string) context.Context
- func TenantId(r *http.Request) string
- func UserId(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
- type Value
- func (s *Value) Array() []any
- func (s *Value) ArrayFloat() []float64
- func (s *Value) ArrayInt() []int
- func (s *Value) ArrayJson() []et.Json
- func (s *Value) ArrayString() []string
- func (s *Value) Bool() bool
- func (s *Value) DateTime() time.Time
- func (s *Value) Float() float64
- func (s *Value) Int() int
- func (s *Value) Object() et.Json
- func (s *Value) Str() string
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 *
func SetApp ¶ added in v1.0.20
* * SetApp * @param ctx context.Context, app string * @return context.Context *
func SetDevice ¶ added in v1.0.20
* * SetDevice * @param ctx context.Context, device string * @return context.Context *
func SetDuration ¶ added in v1.0.20
* * SetDuration * @param ctx context.Context, duration time.Duration * @return context.Context *
func SetPayload ¶ added in v1.0.20
* * SetPayload * @param ctx context.Context, payload et.Json * @return context.Context *
func SetProfileId ¶ added in v1.0.20
* * SetProfileId * @param ctx context.Context, profileId string * @return context.Context *
func SetServiceId ¶ added in v1.0.20
* * SetServiceId * @param ctx context.Context, serviceId string * @return context.Context *
func SetTenantId ¶ added in v1.0.20
* * SetTenantId * @param ctx context.Context, tenantId string * @return context.Context *
func SetUserId ¶ added in v1.0.21
* * SetUserId * @param ctx context.Context, userId string * @return context.Context *
func SetUsername ¶ added in v1.0.20
* * SetUsername * @param ctx context.Context, username string * @return context.Context *
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" UserIdKey ContextKey = "user_id" UsernameKey ContextKey = "username" TenantIdKey ContextKey = "tenant_id" ProfileIdKey ContextKey = "profile_id" )
func (ContextKey) Duration ¶ added in v1.0.12
* * Duration * @param ctx context.Context, def time.Duration * @return time.Duration *
type Value ¶ added in v1.0.21
type Value struct {
// contains filtered or unexported fields
}
func (*Value) ArrayFloat ¶ added in v1.0.21
* * ArrayFloat returns an array of floats * @return []float64 *
func (*Value) ArrayInt ¶ added in v1.0.21
* * ArrayInt returns an array of integers * @return []int *
func (*Value) ArrayJson ¶ added in v1.0.21
* * ArrayJson returns an array of et.Json * @return []et.Json *
func (*Value) ArrayString ¶ added in v1.0.21
* * ArrayString returns an array of strings * @return []string *