hypermedia_controls

package
v0.0.0-...-6312dd6 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Readproperty            OP = "readproperty"
	Writeproperty           OP = "writeproperty"
	Observeproperty         OP = "observeproperty"
	Unobserveproperty       OP = "unobserveproperty"
	Invokeaction            OP = "invokeaction"
	Queryaction             OP = "queryaction"
	Cancelaction            OP = "cancelaction"
	SubscribeEvent          OP = "subscribeevent"
	Unsubscribeevent        OP = "unsubscribeevent"
	Readallproperties       OP = "readallproperties"
	Writeallproperties      OP = "writeallproperties"
	Readmultipleproperties  OP = "readmultipleproperties"
	Writemultipleproperties OP = "writemultipleproperties"
	ObserveallProperties    OP = "observeallproperties"
	Unobserveallproperties  OP = "unobserveallproperties"
	Subscribeallevents      OP = "subscribeallevents"
	Unsubscribeallevents    OP = "unsubscribeallevents"
	Queryallactions         OP = "queryallactions"

	JSON   ContentType = "application/json"
	LdJSON ContentType = "application/ld+json"
)

Variables

This section is empty.

Functions

func JSONGetArray

func JSONGetArray(data []byte, field string) []string

func JSONGetBool

func JSONGetBool(data []byte, field string, defaultValue bool) bool

func JSONGetFloat64

func JSONGetFloat64(data []byte, field string, defaultValue float64) float64

func JSONGetMap

func JSONGetMap(data []byte, field string) map[string]string

func JSONGetString

func JSONGetString(data []byte, field string, defaultValue string) string

func JSONGetUint64

func JSONGetUint64(data []byte, field string, def uint64) uint64

func ToBool

func ToBool(v any) bool

func ToString

func ToString(v any) string

Types

type AdditionalExpectedResponse

type AdditionalExpectedResponse struct {
	ContentType string `json:"contentType,omitempty"`
	Success     bool   `json:"success,omitempty"`
	Schema      string `json:"schema,omitempty"`
}

type ArrayOrString

type ArrayOrString []string

func NewArrayOrString

func NewArrayOrString(args ...string) ArrayOrString

type ContentType

type ContentType = string

type DataSchemaType

type DataSchemaType = string
const (
	TypeNumber  DataSchemaType = "number"
	TypeString  DataSchemaType = "string"
	TypeInteger DataSchemaType = "integer"
	TypeNull    DataSchemaType = "null"
	TypeObject  DataSchemaType = "object"
	TypeArray   DataSchemaType = "array"
	TypeBoolean DataSchemaType = "boolean"
)

type DataTime

type DataTime struct {
	time.Time
}

type Double

type Double float64
const DefaultDouble Double = 0

func ToDouble

func ToDouble(v any) Double

type ExpectedResponse

type ExpectedResponse struct {
	ContentType string
}

type Form

type Form struct {
	Href                URI                          `json:"href" wot:"mandatory"`
	ContentType         ContentType                  `json:"contentType,omitempty" wot:"withDefault"`
	ContentCoding       string                       `json:"contentCoding,omitempty" wot:"optional"`
	Security            ArrayOrString                `json:"security,omitempty" wot:"optional"`
	Scopes              ArrayOrString                `json:"scopes,omitempty" wot:"optional"`
	Response            *ExpectedResponse            `json:"response,omitempty" wot:"optional"`
	AdditionalResponses []AdditionalExpectedResponse `json:"additionalResponses,omitempty" wot:"optional"`
	Subprotocol         string                       `json:"subprotocol,omitempty" wot:"optional"`
	Op                  []OP                         `json:"op,omitempty" wot:"withDefault"`
}

type Integer

type Integer uint
const DefaultInteger Integer = 0

func JSONGetInteger

func JSONGetInteger(data []byte, sep string) *Integer

func ToInteger

func ToInteger(v any) Integer

func (Integer) Compare

func (i Integer) Compare(value Integer) int
type Link struct {
	Href   URI    `json:"href,omitempty"`
	Type   string `json:"type,omitempty"`
	Rel    URI    `json:"rel,omitempty"`
	Anchor any    `json:"anchor,omitempty"`
	Sizes  string `json:"sizes,omitempty"`
}

type MultiLanguage

type MultiLanguage map[string]string

type Number

type Number float64
const DefaultNumber Number = 0

func ToNumber

func ToNumber(v any) Number

func (Number) Compare

func (i Number) Compare(value Number) int

type OP

type OP = string

func NewOpArray

func NewOpArray(args ...OP) []OP

type URI

type URI string

func NewURI

func NewURI(s string) URI

func (URI) GetId

func (u URI) GetId() string

func (URI) GetURI

func (u URI) GetURI() string

func (URI) ToString

func (u URI) ToString() string

type UnsignedInt

type UnsignedInt uint

func ToUnsignedInt

func ToUnsignedInt(v any) UnsignedInt

func (UnsignedInt) Compare

func (i UnsignedInt) Compare(value UnsignedInt) int

Jump to

Keyboard shortcuts

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