dirclient

package
v0.0.0-...-147f0cf Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package capnpclient that wraps the capnp generated client with a POGS API

Package capnpclient that wraps the capnp generated client with a POGS API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirectoryCursorClient

type DirectoryCursorClient struct {
	// contains filtered or unexported fields
}

DirectoryCursorClient provides iterator client for iterating the directory This implements the IDirectoryCursor interface

func NewDirectoryCursorClient

func NewDirectoryCursorClient(hc *hubclient.HubClient, agentID, capID string, cursorKey string) *DirectoryCursorClient

NewDirectoryCursorClient returns a read cursor client Intended for internal use.

hc connection to the Hub
agentID of the directory service
capID of the read capability
cursorKey is the iterator key obtain when requesting the cursor

func (*DirectoryCursorClient) First

func (cl *DirectoryCursorClient) First() (thingValue thing.ThingValue, valid bool, err error)

First positions the cursor at the first key in the ordered list

func (*DirectoryCursorClient) Next

func (cl *DirectoryCursorClient) Next() (thingValue thing.ThingValue, valid bool, err error)

Next moves the cursor to the next key from the current cursor

func (*DirectoryCursorClient) NextN

func (cl *DirectoryCursorClient) NextN(limit uint) (batch []thing.ThingValue, itemsRemaining bool, err error)

NextN moves the cursor to the next N steps from the current cursor

func (*DirectoryCursorClient) Release

func (cl *DirectoryCursorClient) Release()

Release the cursor capability

type ReadDirectoryClient

type ReadDirectoryClient struct {
	// contains filtered or unexported fields
}

ReadDirectoryClient is the messenger client for reading the Thing Directory This implements the IReadDirectory interface

func NewReadDirectoryClient

func NewReadDirectoryClient(hc *hubclient.HubClient) *ReadDirectoryClient

NewReadDirectoryClient creates a instance of a read-directory client This connects to the service with the default directory service name.

func (*ReadDirectoryClient) GetCursor

GetCursor returns an iterator for ThingValue objects containing TD documents

func (*ReadDirectoryClient) GetTD

func (cl *ReadDirectoryClient) GetTD(
	agentID string, thingID string) (tv thing.ThingValue, err error)

GetTD returns a thing value containing the TD document for the given Thing address

func (*ReadDirectoryClient) GetTDs

func (cl *ReadDirectoryClient) GetTDs(
	offset int, limit int) (tv []thing.ThingValue, err error)

GetTDs returns a batch of TD documents. The order is undefined.

type UpdateDirectoryClient

type UpdateDirectoryClient struct {
	// contains filtered or unexported fields
}

UpdateDirectoryClient is the client to updating a directory It can only be obtained from the DirectoryCapnpClient

func NewUpdateDirectoryClient

func NewUpdateDirectoryClient(hc *hubclient.HubClient) *UpdateDirectoryClient

NewUpdateDirectoryClient returns a directory update client for the directory service. This connects to the service with the default directory service name.

func (*UpdateDirectoryClient) RemoveTD

func (cl *UpdateDirectoryClient) RemoveTD(agentID, thingID string) (err error)

RemoveTD removes a TD document from the directory

func (*UpdateDirectoryClient) UpdateTD

func (cl *UpdateDirectoryClient) UpdateTD(agentID, thingID string, tdDoc []byte) (err error)

UpdateTD updates the TD document in the directory If the TD with the given ID doesn't exist it will be added.

Jump to

Keyboard shortcuts

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