internal

package
v0.0.0-...-a589b52 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ThingIDURIVar = "thingID"

Variables

This section is empty.

Functions

This section is empty.

Types

type DirectoryHttpServer

type DirectoryHttpServer struct {
	// transport.TransportServerBase
	modules.HiveModuleBase
	// contains filtered or unexported fields
}

DirectoryHttpServer is the module that handlesdirectory requests over http. This converts the request to RRN messages and sends it downstream to the directory module. It is recommended to place this module before the authorization module.

The http server endpoints follow the specification in: https://w3c.github.io/wot-discovery/#exploration-directory-api

func StartDirectoryHttpServer

func StartDirectoryHttpServer(httpServer transport.IHttpServer, respTimeout time.Duration) *DirectoryHttpServer

Start a new Directory HTTP handler and start listening on the given router

This registers the HTTP API with the router and serves its TD on the .well-known/wot endpoint as per discovery specification.

respTimeout is the maximum time the server waits for a response when forwarding directory requests
 to the directory server.

func (*DirectoryHttpServer) AddTDSecForms

func (srv *DirectoryHttpServer) AddTDSecForms(tdoc *td.TD, includeAffordances bool)

AddTDSecForms updates the given Thing Description with security and forms for this http endpoint.

func (*DirectoryHttpServer) CloseAll

func (srv *DirectoryHttpServer) CloseAll()

CloseAll force-closes all connections. This is a ITransportServer api that does nothing here

func (*DirectoryHttpServer) GetConnectURL

func (srv *DirectoryHttpServer) GetConnectURL() string

Return the base URI this endpoint is listening on Intended for inclusion in the directory TDD

func (*DirectoryHttpServer) GetConnectionByClientID

func (srv *DirectoryHttpServer) GetConnectionByClientID(clientID string) (c transport.IConnection)

ITransportServer stub - not supported in uni-directional transports

func (*DirectoryHttpServer) GetConnectionByConnectionID

func (srv *DirectoryHttpServer) GetConnectionByConnectionID(clientID, connectionID string) (c transport.IConnection)

ITransportServer stub - not supported in uni-directional transports

func (*DirectoryHttpServer) SendNotification

func (srv *DirectoryHttpServer) SendNotification(notif *msg.NotificationMessage)

ITransportServer stub - not supported in uni-directional transports

func (*DirectoryHttpServer) SendRequest

func (srv *DirectoryHttpServer) SendRequest(
	agentID string, req *msg.RequestMessage, replyTo msg.ResponseHandler) (err error)

ITransportServer stub - not supported in uni-directional transports

func (*DirectoryHttpServer) SendResponse

func (srv *DirectoryHttpServer) SendResponse(
	clientID, cid string, resp *msg.ResponseMessage) (err error)

ITransportServer stub - not supported in uni-directional transports

Jump to

Keyboard shortcuts

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