util

package
v0.0.0-...-9ba5f82 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMockBody

func CreateMockBody(body interface{}) io.ReadCloser

func CreateMockEmptyBody

func CreateMockEmptyBody() io.ReadCloser

func CreateMockResponse

func CreateMockResponse(code int) *http.Response

func CreateMockResponseWithBody

func CreateMockResponseWithBody(code int, body interface{}) *http.Response

func CycleJSON

func CycleJSON(src any, tgt any) error

func FromJSON

func FromJSON(msg json.RawMessage, tgt any) error

func IsInSlice

func IsInSlice[T comparable](a T, list []T) bool

func ToJSON

func ToJSON(data any) ([]byte, error)

func ToJSONBytes

func ToJSONBytes(x interface{}, indent bool) []byte

func ToJSONCompact

func ToJSONCompact(x interface{}) string

func ToJSONString

func ToJSONString(x interface{}) string

func Truncate

func Truncate[T any](arr []T, n int) []T

Types

This section is empty.

Jump to

Keyboard shortcuts

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