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 ¶
- type PageToken
- type Server
- func (s *Server) GetDevicesMetadata(_ context.Context, request *gen.GetDevicesMetadataRequest) (*gen.DevicesMetadata, error)
- func (s *Server) ListDevices(_ context.Context, request *gen.ListDevicesRequest) (*gen.ListDevicesResponse, error)
- func (s *Server) PullDevices(request *gen.PullDevicesRequest, server gen.DevicesApi_PullDevicesServer) error
- func (s *Server) PullDevicesMetadata(request *gen.PullDevicesMetadataRequest, ...) error
- func (s *Server) Register(server *grpc.Server)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 (*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
Click to show internal directories.
Click to hide internal directories.