Documentation
¶
Index ¶
- func AddHandler(ctx context.Context, svr *server.Server, config Config, ...) error
- func NewAuth(validator kitNetGrpc.Validator) kitNetGrpc.AuthInterceptors
- func NewDeviceMetadataProjection(deviceID string) eventstore.Model
- func NewEventStoreModelFactory() func(context.Context, string, string) (eventstore.Model, error)
- func NewResourceLinksProjection(deviceID string) eventstore.Model
- func NewResourceProjection() eventstore.Model
- func Register(server *grpc.Server, handler *RequestHandler)
- type APIsConfig
- type ClientsConfig
- type Config
- type Device
- type DeviceDirectory
- type EventBusConfig
- type EventStoreConfig
- type GRPCConfig
- type IdentityStoreConfig
- type Projection
- func (p *Projection) LoadDevicesMetadata(deviceIDFilter, toReloadDevices strings.Set, ...) error
- func (p *Projection) LoadResourceLinks(deviceIDFilter, toReloadDevices strings.Set, ...) error
- func (p *Projection) LoadResourcesWithLinks(resourceIDFilter []*commands.ResourceId, typeFilter strings.Set, ...) error
- func (p *Projection) ReloadDevices(ctx context.Context, deviceIDFilter strings.Set)
- type PublicConfiguration
- type RequestHandler
- func (r *RequestHandler) Close()
- func (r *RequestHandler) GetDevices(req *pb.GetDevicesRequest, srv pb.GrpcGateway_GetDevicesServer) error
- func (r *RequestHandler) GetDevicesMetadata(req *pb.GetDevicesMetadataRequest, srv pb.GrpcGateway_GetDevicesMetadataServer) error
- func (r *RequestHandler) GetEvents(req *pb.GetEventsRequest, srv pb.GrpcGateway_GetEventsServer) error
- func (r *RequestHandler) GetHubConfiguration(context.Context, *pb.HubConfigurationRequest) (*pb.HubConfigurationResponse, error)
- func (r *RequestHandler) GetPendingCommands(req *pb.GetPendingCommandsRequest, srv pb.GrpcGateway_GetPendingCommandsServer) error
- func (r *RequestHandler) GetResourceLinks(req *pb.GetResourceLinksRequest, srv pb.GrpcGateway_GetResourceLinksServer) error
- func (r *RequestHandler) GetResources(req *pb.GetResourcesRequest, srv pb.GrpcGateway_GetResourcesServer) error
- type Resource
- type ResourceDirectory
- type ResourceTwin
- func (rd *ResourceTwin) GetDevicesMetadata(req *pb.GetDevicesMetadataRequest, srv pb.GrpcGateway_GetDevicesMetadataServer) error
- func (rd *ResourceTwin) GetPendingCommands(req *pb.GetPendingCommandsRequest, srv pb.GrpcGateway_GetPendingCommandsServer) error
- func (rd *ResourceTwin) GetResources(req *pb.GetResourcesRequest, srv pb.GrpcGateway_GetResourcesServer) error
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddHandler ¶
func NewAuth ¶
func NewAuth(validator kitNetGrpc.Validator) kitNetGrpc.AuthInterceptors
func NewDeviceMetadataProjection ¶
func NewDeviceMetadataProjection(deviceID string) eventstore.Model
func NewResourceLinksProjection ¶
func NewResourceLinksProjection(deviceID string) eventstore.Model
func NewResourceProjection ¶
func NewResourceProjection() eventstore.Model
func Register ¶
func Register(server *grpc.Server, handler *RequestHandler)
Register registers the handler instance with a gRPC server.
Types ¶
type APIsConfig ¶
type APIsConfig struct {
GRPC GRPCConfig `yaml:"grpc" json:"grpc"`
}
Config represent application configuration
func (*APIsConfig) Validate ¶
func (c *APIsConfig) Validate() error
type ClientsConfig ¶
type ClientsConfig struct { Eventbus EventBusConfig `yaml:"eventBus" json:"eventBus"` Eventstore EventStoreConfig `yaml:"eventStore" json:"eventStore"` IdentityStore IdentityStoreConfig `yaml:"identityStore" json:"identityStore"` OpenTelemetryCollector otelClient.Config `yaml:"openTelemetryCollector" json:"openTelemetryCollector"` }
func (*ClientsConfig) Validate ¶
func (c *ClientsConfig) Validate() error
type Config ¶
type Config struct { Log log.Config `yaml:"log" json:"log"` APIs APIsConfig `yaml:"apis" json:"apis"` Clients ClientsConfig `yaml:"clients" json:"clients"` ExposedHubConfiguration PublicConfiguration `yaml:"publicConfiguration" json:"publicConfiguration"` }
type Device ¶
type Device struct { ID string Content *device.Device ResourceChanged *events.ResourceChanged Metadata *pb.Device_Metadata Endpoints []*commands.EndpointInformation }
type DeviceDirectory ¶
type DeviceDirectory struct {
// contains filtered or unexported fields
}
func NewDeviceDirectory ¶
func NewDeviceDirectory(projection *Projection, deviceIds []string) *DeviceDirectory
NewDeviceDirectory creates new device directory.
func (*DeviceDirectory) GetDevices ¶
func (dd *DeviceDirectory) GetDevices(req *pb.GetDevicesRequest, srv pb.GrpcGateway_GetDevicesServer) (err error)
type EventBusConfig ¶
type EventBusConfig struct { GoPoolSize int `yaml:"goPoolSize" json:"goPoolSize"` NATS natsClient.Config `yaml:"nats" json:"nats"` }
func (*EventBusConfig) Validate ¶
func (c *EventBusConfig) Validate() error
type EventStoreConfig ¶
type EventStoreConfig struct { ProjectionCacheExpiration time.Duration `yaml:"cacheExpiration" json:"cacheExpiration"` Connection eventstoreConfig.Config `yaml:",inline" json:",inline"` }
func (*EventStoreConfig) Validate ¶
func (c *EventStoreConfig) Validate() error
type GRPCConfig ¶
type GRPCConfig struct { OwnerCacheExpiration time.Duration `yaml:"ownerCacheExpiration" json:"ownerCacheExpiration"` server.Config `yaml:",inline" json:",inline"` }
func (*GRPCConfig) Validate ¶
func (c *GRPCConfig) Validate() error
type IdentityStoreConfig ¶
func (*IdentityStoreConfig) Validate ¶
func (c *IdentityStoreConfig) Validate() error
type Projection ¶
type Projection struct { *projectionRA.Projection // contains filtered or unexported fields }
func NewProjection ¶
func NewProjection(ctx context.Context, name string, store eventstore.EventStore, subscriber eventbus.Subscriber, newModelFunc eventstore.FactoryModelFunc, expiration time.Duration) (*Projection, error)
func (*Projection) LoadDevicesMetadata ¶ added in v2.4.0
func (p *Projection) LoadDevicesMetadata(deviceIDFilter, toReloadDevices strings.Set, onDeviceMetadataProjection func(m *deviceMetadataProjection) error) error
func (*Projection) LoadResourceLinks ¶ added in v2.4.0
func (p *Projection) LoadResourceLinks(deviceIDFilter, toReloadDevices strings.Set, onResourceLinkProjection func(m *resourceLinksProjection) error) error
func (*Projection) LoadResourcesWithLinks ¶ added in v2.4.0
func (p *Projection) LoadResourcesWithLinks(resourceIDFilter []*commands.ResourceId, typeFilter strings.Set, toReloadDevices strings.Set, onResource func(*Resource) error) error
func (*Projection) ReloadDevices ¶ added in v2.4.0
func (p *Projection) ReloadDevices(ctx context.Context, deviceIDFilter strings.Set)
type PublicConfiguration ¶
type PublicConfiguration struct { CAPool string `yaml:"caPool" json:"caPool" description:"file path to the root certificate in PEM format"` OwnerClaim string `yaml:"ownerClaim" json:"ownerClaim"` DeviceIDClaim string `yaml:"deviceIDClaim" json:"deviceIdClaim"` HubID string `yaml:"hubID" json:"hubId"` CoapGateway string `yaml:"coapGateway" json:"coapGateway"` DefaultCommandTimeToLive time.Duration `yaml:"defaultCommandTimeToLive" json:"defaultCommandTimeToLive"` Authority string `yaml:"authority" json:"authority"` // contains filtered or unexported fields }
func (PublicConfiguration) ToProto ¶
func (c PublicConfiguration) ToProto() *pb.HubConfigurationResponse
func (*PublicConfiguration) Validate ¶
func (c *PublicConfiguration) Validate() error
type RequestHandler ¶
type RequestHandler struct { pb.UnimplementedGrpcGatewayServer // contains filtered or unexported fields }
RequestHandler handles incoming requests.
func NewRequestHandler ¶
func NewRequestHandler( resourceProjection *Projection, eventstore eventstore.EventStore, publicConfiguration PublicConfiguration, ownerCache *clientIS.OwnerCache, closeFunc fn.FuncList, ) *RequestHandler
NewRequestHandler factory for new RequestHandler.
func (*RequestHandler) Close ¶
func (r *RequestHandler) Close()
func (*RequestHandler) GetDevices ¶
func (r *RequestHandler) GetDevices(req *pb.GetDevicesRequest, srv pb.GrpcGateway_GetDevicesServer) error
func (*RequestHandler) GetDevicesMetadata ¶
func (r *RequestHandler) GetDevicesMetadata(req *pb.GetDevicesMetadataRequest, srv pb.GrpcGateway_GetDevicesMetadataServer) error
func (*RequestHandler) GetEvents ¶
func (r *RequestHandler) GetEvents(req *pb.GetEventsRequest, srv pb.GrpcGateway_GetEventsServer) error
func (*RequestHandler) GetHubConfiguration ¶
func (r *RequestHandler) GetHubConfiguration(context.Context, *pb.HubConfigurationRequest) (*pb.HubConfigurationResponse, error)
func (*RequestHandler) GetPendingCommands ¶
func (r *RequestHandler) GetPendingCommands(req *pb.GetPendingCommandsRequest, srv pb.GrpcGateway_GetPendingCommandsServer) error
func (*RequestHandler) GetResourceLinks ¶
func (r *RequestHandler) GetResourceLinks(req *pb.GetResourceLinksRequest, srv pb.GrpcGateway_GetResourceLinksServer) error
func (*RequestHandler) GetResources ¶
func (r *RequestHandler) GetResources(req *pb.GetResourcesRequest, srv pb.GrpcGateway_GetResourcesServer) error
type Resource ¶
func (*Resource) GetContent ¶
func (*Resource) GetResourceChanged ¶
func (r *Resource) GetResourceChanged() *events.ResourceChanged
type ResourceDirectory ¶
type ResourceDirectory struct {
// contains filtered or unexported fields
}
func NewResourceDirectory ¶
func NewResourceDirectory(projection *Projection, deviceIds []string) *ResourceDirectory
func (*ResourceDirectory) GetResourceLinks ¶
func (rd *ResourceDirectory) GetResourceLinks(in *pb.GetResourceLinksRequest, srv pb.GrpcGateway_GetResourceLinksServer) error
type ResourceTwin ¶ added in v2.6.0
type ResourceTwin struct {
// contains filtered or unexported fields
}
func NewResourceTwin ¶ added in v2.6.0
func NewResourceTwin(projection *Projection, deviceIds []string) *ResourceTwin
func (*ResourceTwin) GetDevicesMetadata ¶ added in v2.6.0
func (rd *ResourceTwin) GetDevicesMetadata(req *pb.GetDevicesMetadataRequest, srv pb.GrpcGateway_GetDevicesMetadataServer) error
func (*ResourceTwin) GetPendingCommands ¶ added in v2.6.0
func (rd *ResourceTwin) GetPendingCommands(req *pb.GetPendingCommandsRequest, srv pb.GrpcGateway_GetPendingCommandsServer) error
func (*ResourceTwin) GetResources ¶ added in v2.6.0
func (rd *ResourceTwin) GetResources(req *pb.GetResourcesRequest, srv pb.GrpcGateway_GetResourcesServer) error
Source Files
¶
- config.go
- deviceDirectory.go
- deviceMetadataProjection.go
- getDevices.go
- getDevicesMetadata.go
- getEvents.go
- getHubConfiguration.go
- getPendingCommands.go
- getResourceLinks.go
- getResources.go
- grpcApi.go
- projection.go
- resource.go
- resourceDirectory.go
- resourceLinksProjection.go
- resourceProjection.go
- resourceShadow.go
- service.go
Click to show internal directories.
Click to hide internal directories.