utils

package module
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2025 License: MIT Imports: 14 Imported by: 55

README

Utils

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallerGetInfo added in v0.1.4

func CallerGetInfo(offset int) (string, string, int)

func Contains

func Contains(items interface{}, item interface{}) bool

Contains ...

func Content added in v0.1.5

func Content(contentOrPath string) ([]byte, error)

func DirExists added in v0.2.4

func DirExists(path string) bool

func EnvGet added in v0.1.3

func EnvGet(key string, defaultValue interface{}) interface{}

func FileExists added in v0.1.6

func FileExists(path string) bool

func GoRoutineID added in v0.2.2

func GoRoutineID() uint64

func HttpDeleteRaw added in v0.3.2

func HttpDeleteRaw(client *http.Client, URL, contentType string, authorization string, raw []byte) ([]byte, error)

func HttpDeleteRawWithHeaders added in v0.3.2

func HttpDeleteRawWithHeaders(client *http.Client, URL string, headers map[string]string, raw []byte) ([]byte, error)

func HttpGetHeader added in v0.4.6

func HttpGetHeader(client *http.Client, URL string) (map[string][]string, error)

func HttpGetRaw added in v0.3.0

func HttpGetRaw(client *http.Client, URL, contentType string, authorization string) ([]byte, error)

func HttpGetRawRetry added in v0.4.7

func HttpGetRawRetry(client *http.Client, URL, contentType string, authorization string, maxRetries int, retryHeader string) ([]byte, error)

func HttpGetRawWithHeaders added in v0.3.0

func HttpGetRawWithHeaders(client *http.Client, URL string, headers map[string]string) ([]byte, error)

func HttpGetRawWithHeadersRetry added in v0.4.7

func HttpGetRawWithHeadersRetry(client *http.Client, URL string, headers map[string]string, maxRetries int, retryHeader string) ([]byte, error)

func HttpPatchRaw added in v0.4.8

func HttpPatchRaw(client *http.Client, URL, contentType string, authorization string, raw []byte) ([]byte, error)

func HttpPatchRawWithHeaders added in v0.4.8

func HttpPatchRawWithHeaders(client *http.Client, URL string, headers map[string]string, raw []byte) ([]byte, error)

func HttpPostRaw added in v0.3.0

func HttpPostRaw(client *http.Client, URL, contentType string, authorization string, raw []byte) ([]byte, error)

func HttpPostRawOutCode added in v0.3.0

func HttpPostRawOutCode(client *http.Client, URL, contentType string, authorization string, raw []byte) (body []byte, code int, err error)

func HttpPostRawRetry added in v0.4.7

func HttpPostRawRetry(client *http.Client, URL, contentType string, authorization string, raw []byte, maxRetries int, retryHeader string) ([]byte, error)

func HttpPostRawWithHeaders added in v0.3.0

func HttpPostRawWithHeaders(client *http.Client, URL string, headers map[string]string, raw []byte) ([]byte, error)

func HttpPostRawWithHeadersOutCode added in v0.3.0

func HttpPostRawWithHeadersOutCode(client *http.Client, URL string, headers map[string]string, raw []byte) (body []byte, code int, err error)

func HttpPostRawWithHeadersRetry added in v0.4.7

func HttpPostRawWithHeadersRetry(client *http.Client, URL string, headers map[string]string, raw []byte, maxRetries int, retryHeader string) ([]byte, error)

func HttpPutRaw added in v0.3.0

func HttpPutRaw(client *http.Client, URL, contentType string, authorization string, raw []byte) ([]byte, error)

func HttpPutRawWithHeaders added in v0.3.0

func HttpPutRawWithHeaders(client *http.Client, URL string, headers map[string]string, raw []byte) ([]byte, error)

func HttpRequestGetHeader added in v0.4.6

func HttpRequestGetHeader(client *http.Client, URL string) (header map[string][]string, err error)

func HttpRequestRawWithHeaders added in v0.3.0

func HttpRequestRawWithHeaders(client *http.Client, method, URL string, headers map[string]string, raw []byte) ([]byte, error)

func HttpRequestRawWithHeadersOutCode added in v0.3.0

func HttpRequestRawWithHeadersOutCode(client *http.Client, method, URL string, headers map[string]string, raw []byte) (body []byte, code int, err error)

func HttpRequestRawWithHeadersOutCodeSilent added in v0.4.7

func HttpRequestRawWithHeadersOutCodeSilent(client *http.Client, method, URL string, headers map[string]string, raw []byte) (body []byte, code int, err error)

func HttpRequestRawWithHeadersRetry added in v0.4.7

func HttpRequestRawWithHeadersRetry(client *http.Client, method, URL string, headers map[string]string, raw []byte, maxRetries int, retryHeader string) ([]byte, error)

func HttpRequestRawWithRetry added in v0.4.7

func HttpRequestRawWithRetry(client *http.Client, method, URL string, headers map[string]string, raw []byte, maxRetries int, retryHeader string) (body []byte, code int, err error)

func Index added in v0.2.0

func Index(items interface{}, item interface{}) int

func IsEmpty

func IsEmpty(v interface{}) bool

IsEmpty ...

func MapGetKeyValues

func MapGetKeyValues(s string) map[string]string

func MapGetKeyValuesEx added in v0.4.4

func MapGetKeyValuesEx(s, sequenceDelim, keyValueDelim string) map[string]string

func MapToArray

func MapToArray(m map[string]string) []string

func MapToArrayWithSeparator

func MapToArrayWithSeparator(m map[string]string, s string) []string

func NewHttpClient

func NewHttpClient(timeout int, insecure bool) *http.Client

func NewHttpInsecureClient

func NewHttpInsecureClient(timeout int) *http.Client

func NewHttpSecureClient

func NewHttpSecureClient(timeout int) *http.Client

Types

This section is empty.

Jump to

Keyboard shortcuts

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