reader

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONLD

type JSONLD interface {

	// AsObject returns this document as a JSON-LD Object.  The "property" argument designates
	// the property to populate if the document is not already an object
	AsObject(property string) JSONLD

	// AsString returns this document as a string.  The "property" argument designates
	// the property to use as a string value if the document is not already a string
	AsString(property string) string

	// AsInt returns this document as a time.Time.  The "property" argument designated
	// the property to use as a string value if the document is not already a string
	AsTime(property string) time.Time

	// AsInt returns this document as an int.  The "property" argument designated
	// the property to use as a string value if the document is not already a string
	AsInt(property string) int

	// AsSliceOfString returns this document as a slice of strings.  The "property" argument designates
	// the property to use as a string value if the document is not already a string
	AsSliceOfString(property string) []string

	// AsSliceOfObject returns this document as a slice of JSON-LD Objects.  The "property" argument designates
	// the property to populate if the document is not already an object
	AsSliceOfObject(property string) []JSONLD

	// Property returns a property of this document as its own JSON-LD document
	Property(property string) JSONLD

	// PropertyMap retrieves a string value from this document, trying first to use the
	// multi-lingual <propertyName>Map collection first.  If the requested language is
	// not found, then the default language (or the naked property string) value is returned.
	PropertyMap(property string, languages ...string) string

	// Len returns the number of documents in a series.  If this is not a series,
	// then Len() returns 1.
	Len() int

	// Head returns the first JSONLD document in a series.  If this is not a series,
	// then Head() returns this document
	Head() JSONLD

	// Tail returns a series contining all but the first document in a series.  If this
	// is not a series, then Tail() returns nil
	Tail() JSONLD
}

func New

func New(value interface{}) JSONLD

type Map

type Map map[string]interface{}

func (Map) AsInt

func (m Map) AsInt(property string) int

AsInt returns this document as an int

func (Map) AsObject

func (m Map) AsObject(property string) JSONLD

AsObject returns this document as an object

func (Map) AsSliceOfObject

func (m Map) AsSliceOfObject(property string) []JSONLD

AsSliceOfObject returns this document as a slice of Objects

func (Map) AsSliceOfString

func (m Map) AsSliceOfString(property string) []string

AsSliceOfString returns this document as a slice of strings

func (Map) AsString

func (m Map) AsString(property string) string

AsString returns this document as a string

func (Map) AsTime

func (m Map) AsTime(property string) time.Time

AsTime returns this document as an int

func (Map) GetStringMap

func (m Map) GetStringMap(property string, languages ...string) string

GetStringMap returns a property of this JSONLD document from a multi-language mapped value

func (Map) Head

func (m Map) Head() JSONLD

Head returns the first JSONLD document in a series

func (Map) Len

func (m Map) Len() int

func (Map) Property

func (m Map) Property(property string) JSONLD

Property returns a property of this document as a JSON-LD object

func (Map) PropertyMap

func (m Map) PropertyMap(property string, languages ...string) string

PropertyMap returns a property of this document

func (Map) Tail

func (m Map) Tail() JSONLD

type Slice

type Slice []interface{}

func (Slice) AsInt

func (s Slice) AsInt(property string) int

AsInt returns this document as an int

func (Slice) AsObject

func (s Slice) AsObject(property string) JSONLD

AsObject returns this document as an Object

func (Slice) AsSliceOfObject

func (s Slice) AsSliceOfObject(property string) []JSONLD

AsSliceOfObject returns this document as a slice of Objects

func (Slice) AsSliceOfString

func (s Slice) AsSliceOfString(property string) []string

AsSliceOfString returns this document as a slice of strings

func (Slice) AsString

func (s Slice) AsString(property string) string

AsString returns this document as a string

func (Slice) AsTime

func (s Slice) AsTime(property string) time.Time

AsTime returns this document as an int

func (Slice) Head

func (s Slice) Head() JSONLD

Head returns the first JSONLD document in a series

func (Slice) Len

func (s Slice) Len() int

Len returns the length of a series

func (Slice) Property

func (s Slice) Property(property string) JSONLD

Property returns a property of this document

func (Slice) PropertyMap

func (s Slice) PropertyMap(property string, languages ...string) string

PropertyMap returns a property of this document

func (Slice) Tail

func (s Slice) Tail() JSONLD

Tail returns the series without the head document

type String

type String string

func (String) AsInt

func (s String) AsInt(property string) int

AsInt returns this document as an int

func (String) AsObject

func (s String) AsObject(property string) JSONLD

AsObject returns this document as an Object

func (String) AsSliceOfObject

func (s String) AsSliceOfObject(property string) []JSONLD

AsSliceOfObject returns this document as a slice of Objects

func (String) AsSliceOfString

func (s String) AsSliceOfString(property string) []string

AsSliceOfString returns this document as a slice of strings

func (String) AsString

func (s String) AsString(property string) string

AsString returns this document as a string

func (String) AsTime

func (s String) AsTime(property string) time.Time

AsTime returns this document as an int

func (String) Head

func (s String) Head() JSONLD

Head returns the first JSONLD document in a series

func (String) Len

func (s String) Len() int

Len returns the length of a series

func (String) Property

func (s String) Property(property string) JSONLD

Property returns a property of this document

func (String) PropertyMap

func (s String) PropertyMap(property string, languages ...string) string

PropertyMap returns a property of this document

func (String) Tail

func (s String) Tail() JSONLD

Tail returns the series without the head document

type Zero

type Zero struct{}

Zero reader has no value

func (Zero) AsInt

func (z Zero) AsInt(property string) int

AsInt returns this document as an int

func (Zero) AsObject

func (z Zero) AsObject(property string) JSONLD

AsObject returns this document as an Object

func (Zero) AsSliceOfObject

func (z Zero) AsSliceOfObject(property string) []JSONLD

AsSliceOfObject returns this document as a slice of Objects

func (Zero) AsSliceOfString

func (z Zero) AsSliceOfString(property string) []string

AsSliceOfString returns this document as a slice of strings

func (Zero) AsString

func (z Zero) AsString(property string) string

AsString returns this document as a string

func (Zero) AsTime

func (z Zero) AsTime(property string) time.Time

AsTime returns this document as an int

func (Zero) Head

func (z Zero) Head() JSONLD

Head returns the first JSONLD document in a series

func (Zero) Len

func (z Zero) Len() int

Len returns the length of a series

func (Zero) Property

func (z Zero) Property(property string) JSONLD

Property returns a property of this document

func (Zero) PropertyMap

func (z Zero) PropertyMap(property string, languages ...string) string

PropertyMap returns a property of this document

func (Zero) Tail

func (z Zero) Tail() JSONLD

Tail returns the series without the head document

Jump to

Keyboard shortcuts

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