types

package
v0.0.0-...-0b43983 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseEntity

type BaseEntity struct {
	ID      string   `json:"id"`
	Type    string   `json:"type"`
	Context []string `json:"@context"`
}

BaseEntity contains the required base properties an Entity must have

type DateTimeProperty

type DateTimeProperty struct {
	Property
	Value struct {
		Type  string `json:"@type"`
		Value string `json:"@value"`
	} `json:"value"`
}

DateTimeProperty stores date and time values (surprise, surprise ...)

func CreateDateTimeProperty

func CreateDateTimeProperty(value string) *DateTimeProperty

CreateDateTimeProperty creates a property from a UTC time stamp

type MultiObjectRelationship

type MultiObjectRelationship struct {
	Relationship
	Object []string `json:"object"`
}

MultiObjectRelationship stores information about an entity's relation to multiple objects

func NewMultiObjectRelationship

func NewMultiObjectRelationship(objects []string) MultiObjectRelationship

NewMultiObjectRelationship accepts an array of object ID:s and returns a new MultiObjectRelationship

type NumberProperty

type NumberProperty struct {
	Property
	Value    float64 `json:"value"`
	UnitCode *string `json:"unitCode,omitempty"`
}

NumberProperty holds a float64 Value

func NewNumberProperty

func NewNumberProperty(value float64) *NumberProperty

NewNumberProperty is a convenience function for creating NumberProperty instances

func NewNumberPropertyFromInt

func NewNumberPropertyFromInt(value int) *NumberProperty

NewNumberPropertyFromInt accepts a value as an int and returns a new NumberProperty

func NewNumberPropertyFromString

func NewNumberPropertyFromString(value string) *NumberProperty

NewNumberPropertyFromString accepts a value as a string and returns a new NumberProperty

func NewNumberPropertyWithUnitCode

func NewNumberPropertyWithUnitCode(value float64, code string) *NumberProperty

NewNumberPropertyWithUnitCode is a convenience function for creating NumberProperty instances with a unit code

type Property

type Property struct {
	Type string `json:"type"`
}

Property contains the mandatory Type property

type Relationship

type Relationship struct {
	Type string `json:"type"`
}

Relationship is a base type for all types of relationships

type RoadSegmentLocation

type RoadSegmentLocation struct {
	Property
	Value struct {
		Type        string       `json:"type"`
		Coordinates [][2]float64 `json:"coordinates"`
	} `json:"value"`
}

func NewRoadSegmentLocation

func NewRoadSegmentLocation(roadCoords [][2]float64) RoadSegmentLocation

type SingleObjectRelationship

type SingleObjectRelationship struct {
	Relationship
	Object string `json:"object"`
}

SingleObjectRelationship stores information about an entity's relation to a single object

func NewSingleObjectRelationship

func NewSingleObjectRelationship(object string) *SingleObjectRelationship

NewSingleObjectRelationship accepts an object ID as a string and returns a new SingleObjectRelationship

type TextListProperty

type TextListProperty struct {
	Property
	Value []string `json:"value"`
}

TextListProperty stores values of type text list

func NewTextListProperty

func NewTextListProperty(value []string) *TextListProperty

NewTextListProperty accepts a value as a string array and returns a new TextListProperty

type TextProperty

type TextProperty struct {
	Property
	Value string `json:"value"`
}

TextProperty stores values of type text

func NewTextProperty

func NewTextProperty(value string) *TextProperty

NewTextProperty accepts a value as a string and returns a new TextProperty

Jump to

Keyboard shortcuts

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