thingDescription

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ResourceURI  = "/.well-known/wot"
	ResourceType = "wot.thing"
)

Variables

View Source
var MessageTypeTDJson = message.MediaType(432) ///< application/td+json

Functions

func GetOCFResourcePropertyElement

func GetOCFResourcePropertyElement(resourceHref string) (thingDescription.PropertyElement, bool)

func GetOCFThingDescription

func GetOCFThingDescription() thingDescription.ThingDescription

Types

type GetThingDescription

type GetThingDescription func(ctx context.Context, endpoints schema.Endpoints) *thingDescription.ThingDescription

type RegisterSubscription

type RegisterSubscription func(subscription func(td *thingDescription.ThingDescription, closed bool)) func()

type Resource

type Resource struct {
	*resources.Resource
	// contains filtered or unexported fields
}

func New

func New(uri string, onGetThingDescription GetThingDescription, onRegisterSubscription RegisterSubscription) *Resource

func (*Resource) CreateSubscription

func (r *Resource) CreateSubscription(req *net.Request, handler func(*pool.Message, error)) (func(), error)

func (*Resource) Get

func (r *Resource) Get(request *net.Request) (*pool.Message, error)

Jump to

Keyboard shortcuts

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