Documentation ¶
Index ¶
- func AddHandler(ctx context.Context, svr *server.Server, config Config, ...) error
- func NewAuth(validator kitNetGrpc.Validator, ownerClaim string) kitNetGrpc.AuthInterceptors
- func NewDeviceMetadataProjection() eventstore.Model
- func NewEventStoreModelFactory() func(context.Context, string, string) (eventstore.Model, error)
- func NewResourceLinksProjection() 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(ctx context.Context, deviceIDFilter, toReloadDevices strings.Set, ...) error
- func (p *Projection) LoadResourceLinks(ctx context.Context, deviceIDFilter, toReloadDevices strings.Set, ...) error
- func (p *Projection) LoadResourcesWithLinks(ctx context.Context, resourceIDFilter []*commands.ResourceId, ...) 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 ResourceShadow
- func (rd *ResourceShadow) GetDevicesMetadata(req *pb.GetDevicesMetadataRequest, srv pb.GrpcGateway_GetDevicesMetadataServer) error
- func (rd *ResourceShadow) GetPendingCommands(req *pb.GetPendingCommandsRequest, srv pb.GrpcGateway_GetPendingCommandsServer) error
- func (rd *ResourceShadow) 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, ownerClaim string) kitNetGrpc.AuthInterceptors
func NewDeviceMetadataProjection ¶
func NewDeviceMetadataProjection() eventstore.Model
func NewResourceLinksProjection ¶
func NewResourceLinksProjection() 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 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 (*Projection) LoadResourceLinks ¶ added in v2.4.0
func (*Projection) LoadResourcesWithLinks ¶ added in v2.4.0
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"` AuthorizationServer string `yaml:"authorizationServer" json:"authorizationServer"` // 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 ResourceShadow ¶
type ResourceShadow struct {
// contains filtered or unexported fields
}
func NewResourceShadow ¶
func NewResourceShadow(projection *Projection, deviceIds []string) *ResourceShadow
func (*ResourceShadow) GetDevicesMetadata ¶
func (rd *ResourceShadow) GetDevicesMetadata(req *pb.GetDevicesMetadataRequest, srv pb.GrpcGateway_GetDevicesMetadataServer) error
func (*ResourceShadow) GetPendingCommands ¶
func (rd *ResourceShadow) GetPendingCommands(req *pb.GetPendingCommandsRequest, srv pb.GrpcGateway_GetPendingCommandsServer) error
func (*ResourceShadow) GetResources ¶
func (rd *ResourceShadow) 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.