Documentation ¶
Index ¶
- func CreateMockBody(body interface{}) io.ReadCloser
- func CreateMockEmptyBody() io.ReadCloser
- func CreateMockResponse(code int) *http.Response
- func CreateMockResponseWithBody(code int, body interface{}) *http.Response
- func CycleJSON(src any, tgt any) error
- func FromJSON(msg json.RawMessage, tgt any) error
- func IsInSlice[T comparable](a T, list []T) bool
- func ToJSON(data any) ([]byte, error)
- func ToJSONBytes(x interface{}, indent bool) []byte
- func ToJSONCompact(x interface{}) string
- func ToJSONString(x interface{}) string
- func Truncate[T any](arr []T, n int) []T
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 IsInSlice ¶
func IsInSlice[T comparable](a T, list []T) bool
func ToJSONBytes ¶
func ToJSONCompact ¶
func ToJSONCompact(x interface{}) string
func ToJSONString ¶
func ToJSONString(x interface{}) string
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.