utils

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllPages added in v1.0.8

func GetAllPages[T any](apiCall, method string, apiClient *apiclient.APIClient) ([]*T, error)

getAllPages will get all pages of an API call when the API call is paged input is the apicall, method and client returns a slice of items

func UnwrapItems

func UnwrapItems[T any](jsonAsByte []byte) ([]*T, error)

unwrapItems will unwrap the items from the json items[] array input is the json output from the API (GET) call as []byte returns a slice of items

func WrapItems

func WrapItems(item any) *itemWrapper[any]

wrapItems will wrapp all the items in a json items[] array returns a itemWrapper, which is a json object with the items[] array

Types

This section is empty.

Jump to

Keyboard shortcuts

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