Documentation
¶
Index ¶
- type APIConfig
- type CoAPConfig
- type Config
- type Device
- type NewDeviceFunc
- type Option
- type OptionsCfg
- type Service
- func (c *Service) CopyDevices() map[uuid.UUID]Device
- func (c *Service) CreateDevice(id uuid.UUID, newDevice NewDeviceFunc) (Device, error)
- func (c *Service) DefaultRequestHandler(req *net.Request) (*pool.Message, error)
- func (c *Service) DeleteAndCloseDevice(id uuid.UUID) bool
- func (c *Service) GetAndDeleteDevice(id uuid.UUID) (Device, bool)
- func (c *Service) GetDevice(id uuid.UUID) (Device, bool)
- func (c *Service) GetOrCreateDevice(id uuid.UUID, newDevice NewDeviceFunc) (d Device, loaded bool, err error)
- func (c *Service) Length() int
- func (c *Service) LoadDevice(di uuid.UUID) (Device, error)
- func (c *Service) Range(f func(key uuid.UUID, value Device) bool)
- func (c *Service) RangeWithLock(f func(key uuid.UUID, value Device) bool)
- func (c *Service) Serve() error
- func (c *Service) Shutdown() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIConfig ¶
type APIConfig struct {
CoAP CoAPConfig `yaml:"coap"`
}
type CoAPConfig ¶
func (*CoAPConfig) Validate ¶
func (c *CoAPConfig) Validate() error
type Device ¶
type Device interface { Init() // start all goroutines for device Close() // stop all goroutines for device ExportConfig() device.Config // export device config GetID() uuid.UUID GetLinks(request *net.Request) (links schema.ResourceLinks) GetLinksFilteredBy(endpoints schema.Endpoints, deviceIDfilter uuid.UUID, resourceTypesFilter []string, policyBitMaskFitler schema.BitMask) (links schema.ResourceLinks) GetName() string GetProtocolIndependentID() uuid.UUID GetResourceTypes() []string HandleRequest(req *net.Request) (*pool.Message, error) Range(f func(key string, resource device.Resource) bool) AddResources(resources ...device.Resource) LoadAndDeleteResource(resourceHref string) (device.Resource, bool) CloseAndDeleteResource(resourceHref string) bool GetResource(resourceHref string) (device.Resource, bool) GetCloudManager() *cloud.Manager GetLoop() *eventloop.Loop GetThingDescriptionManager() *thingDescription.Manager }
type OptionsCfg ¶
type OptionsCfg struct {
// contains filtered or unexported fields
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) CreateDevice ¶
func (*Service) DefaultRequestHandler ¶
func (*Service) GetAndDeleteDevice ¶
func (*Service) GetOrCreateDevice ¶
func (*Service) RangeWithLock ¶
Click to show internal directories.
Click to hide internal directories.