meta

package
v0.0.0-...-931a7b5 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyObject = []byte(`{ "created": 0, "updated": 0, "index": "", "data": {} }`)

Empty meta object byte array value

Functions

func Encode

func Encode(v interface{}) ([]byte, error)

Encode meta objects in json

func New

func New(obj *Object) []byte

New meta object as json

func SortAsc

func SortAsc(obj []Object) func(i, j int) bool

func SortDesc

func SortDesc(obj []Object) func(i, j int) bool

SortDesc by created

Types

type Object

type Object struct {
	Created int64           `json:"created"`
	Updated int64           `json:"updated"`
	Index   string          `json:"index"`
	Path    string          `json:"path"`
	Data    json.RawMessage `json:"data"`
}

Meta data structure of elements

func Decode

func Decode(data []byte) (Object, error)

Decode json meta object

func DecodeFromReader

func DecodeFromReader(r io.Reader) (Object, error)

DecodeFromReader meta object from io reader

func DecodeList

func DecodeList(data []byte) ([]Object, error)

DecodeList json

func DecodeListFromReader

func DecodeListFromReader(r io.Reader) ([]Object, error)

DecodeListFromReader meta objects from io reader

Jump to

Keyboard shortcuts

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