jsonapi

package
v0.0.0-...-bb2c1c1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertType

func ConvertType(raw string) types.Type

ConvertType converts a type (file or directory) from a string to the types.Type enum.

func ParseDoc

func ParseDoc(r io.Reader) (*remote.Doc, error)

ParseDoc tries to parse a JSON-API document from a reader, and then converts it to remote.Doc.

func ParseList

func ParseList(r io.Reader) ([]*remote.Doc, error)

ParseDoc tries to parse a JSON-API list from a reader, and then converts it to a slice of remote.Doc.

Types

type Data

type Data struct {
	ID   string `json:"id"`
	Meta struct {
		Rev string `json:"rev"`
	} `json:"meta"`
	Attributes struct {
		Type  string `json:"type"`
		Name  string `json:"name"`
		DirID string `json:"dir_id"`
	} `json:"attributes"`
}

Data describes an item inside data.

type Doc

type Doc struct {
	Data Data `json:"data"`
}

Doc describes a JSON-API document. See https://jsonapi.org/format/#document-structure

type List

type List struct {
	Data []Data `json:"data"`
}

List describes a JSON-API list of documents.

Jump to

Keyboard shortcuts

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