devices

package
v0.2024.5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Package devices provides mechanisms for querying devices on a node. If you want to find all the lighting devices on floor 2, this is the package you need.

Example (IsMessageValueStringFunc)
msg := &gen.Device{
	Name: "MyDevice",
	Metadata: &traits.Metadata{
		Membership: &traits.Metadata_Membership{
			Subsystem: "Lighting",
		},
	},
}

member := isMessageValueStringFunc("metadata.membership.subsystem", msg, func(v string) bool {
	return v == "Lighting"
})
fmt.Println(member)
Output:

true

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PageToken

type PageToken struct {
	LastName string `json:"n"`
}

type Server

type Server struct {
	gen.UnimplementedDevicesApiServer

	// ChildPageSize overrides the default page size used when querying the parent trait for children
	ChildPageSize int32
	// contains filtered or unexported fields
}

func NewServer

func NewServer(n *node.Node) *Server

func (*Server) GetDevicesMetadata

func (s *Server) GetDevicesMetadata(_ context.Context, request *gen.GetDevicesMetadataRequest) (*gen.DevicesMetadata, error)

func (*Server) ListDevices

func (s *Server) ListDevices(_ context.Context, request *gen.ListDevicesRequest) (*gen.ListDevicesResponse, error)

func (*Server) PullDevices

func (s *Server) PullDevices(request *gen.PullDevicesRequest, server gen.DevicesApi_PullDevicesServer) error

func (*Server) PullDevicesMetadata

func (s *Server) PullDevicesMetadata(request *gen.PullDevicesMetadataRequest, server gen.DevicesApi_PullDevicesMetadataServer) error

func (*Server) Register

func (s *Server) Register(server *grpc.Server)

Jump to

Keyboard shortcuts

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