transport

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credentials

type Credentials interface {
	GetDeviceID() string
	GetHostName() string
	GetCertificate() *tls.Certificate
	Token(resource string, lifetime time.Duration) (*common.SharedAccessSignature, error)
	TokenFromEdge(workloadURI, module, genid, resource string, lifetime time.Duration) (*common.SharedAccessSignature, error)
	GetSAK() string
	GetModuleID() string
	GetGenerationID() string
	GetGateway() string
	GetBroker() string
	GetWorkloadURI() string
	UseEdgeGateway() bool
}

Credentials interface.

type MessageDispatcher

type MessageDispatcher interface {
	Dispatch(msg *common.Message)
}

MessageDispatcher handles incoming messages.

type MethodDispatcher

type MethodDispatcher interface {
	Dispatch(methodName string, b []byte) (rc int, data []byte, err error)
}

MethodDispatcher handles direct method calls.

type Transport

type Transport interface {
	SetLogger(logger logger.Logger)
	Connect(ctx context.Context, creds Credentials) error
	Send(ctx context.Context, msg *common.Message) error
	RegisterDirectMethods(ctx context.Context, mux MethodDispatcher) error
	SubscribeEvents(ctx context.Context, mux MessageDispatcher) error
	SubscribeTwinUpdates(ctx context.Context, mux TwinStateDispatcher) error
	RetrieveTwinProperties(ctx context.Context) (payload []byte, err error)
	UpdateTwinProperties(ctx context.Context, payload []byte) (version int, err error)
	Close() error
}

Transport interface.

type TwinStateDispatcher

type TwinStateDispatcher interface {
	Dispatch(b []byte)
}

TwinStateDispatcher handles twin state updates.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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