jsonapi

package
v0.0.0-...-4e58165 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(w io.Writer, v interface{}) (err error)

Encode returns the JSON API encoding of v. It requires v to be a pointer to struct or a slice of pointers to structs.

Types

type Offset

type Offset struct {
	First, Last, Prev, Next int
}

Offset represents the pagination offset returned in the API response when there's a list of resources.

func Decode

func Decode(r io.Reader, v interface{}) (offset Offset, err error)

Decode parses the JSON API encoded data and stores the result in the value pointed to by v. It requires v to be a pointer to struct or pointer to slice.

Jump to

Keyboard shortcuts

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