Documentation ¶
Index ¶
- func AppendSlices[T any](slices ...[]T) []T
- func BuildRequestEndpoint(baseEndpoint, path string) string
- func DecodeB64(data string) ([]byte, error)
- func EncodeB64[T BytesLike](data T) string
- func FormatTime(t time.Time, withUtcOffset bool) string
- func FormatTimeUTC(t time.Time) string
- func FormatTimeWithZone(t time.Time, tz string, withUtcOffset bool) string
- func FromPointer[T any](val *T) (T, bool)
- func HttpClientWithTimeout(timeout time.Duration) *http.Client
- func SHA256[T BytesLike](data T) (sum []byte)
- func SHA256Hex[T BytesLike](data T) (sumHex string)
- func SHA3[T BytesLike](data T) (sum []byte)
- func SHA3Hex[T BytesLike](data T) (sumHex string)
- func SliceFirst[T any](data []T) (first T)
- func SliceIncludes[T comparable](data []T, want T) (found bool)
- func SliceLast[T any](data []T) (last T)
- func TimeoutFromContext(ctx context.Context) (time.Duration, bool)
- func ToLocalTime(t time.Time) time.Time
- func ToPointer[T any](val T) *T
- func UnmarshalConfig(data []byte, confType ConfigFileType, dest any) error
- func Wait(ctx context.Context, d time.Duration)
- type BytesLike
- type ConfigFileType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendSlices ¶
func AppendSlices[T any](slices ...[]T) []T
AppendSlices is _not_ an efficient function by any means.
func BuildRequestEndpoint ¶
func FormatTimeUTC ¶
func FormatTimeWithZone ¶
func FromPointer ¶
FromPointer returns the dereferenced value of a pointer, along with a bool representing whether a nil value was passed, and thus, a zero value for the value's underlying type returned. If val is nil, the zero value for val's underlying type is returned, along with false.
func SliceFirst ¶
func SliceFirst[T any](data []T) (first T)
func SliceIncludes ¶
func SliceIncludes[T comparable](data []T, want T) (found bool)
func ToPointer ¶
func ToPointer[T any](val T) *T
ToPointer returns the pointer value of whatever is passed to it.
func UnmarshalConfig ¶
func UnmarshalConfig(data []byte, confType ConfigFileType, dest any) error
Types ¶
type ConfigFileType ¶
type ConfigFileType uint8
const ( JsonConfig ConfigFileType YamlConfig TomlConfig )
func ConfigFileTypeFromExtension ¶
func ConfigFileTypeFromExtension(ext string) ConfigFileType
Click to show internal directories.
Click to hide internal directories.