Documentation ¶
Index ¶
- func AddHandler(svr *kitNetGrpc.Server, config HandlerConfig, clientTLS tls.Config) error
- func GrpcResourceID2ResourceID(resourceId *pb.ResourceId) string
- func NewDeviceSubscription(id, userID string, send SendEventFunc, ...) *deviceSubscription
- func NewDevicesSubscription(id, userID string, send SendEventFunc, ...) *devicesSubscription
- func NewResourceCtx(subscriptions *subscriptions, ...) func(context.Context) (eventstore.Model, error)
- func NewResourceSubscription(id, userID string, send SendEventFunc, ...) *resourceSubscription
- func NewSubscription(userID, id string, send SendEventFunc, ...) *subscription
- func NewSubscriptions() *subscriptions
- func Register(server *grpc.Server, handler *RequestHandler)
- type Config
- type HandlerConfig
- type RequestHandler
- func (r *RequestHandler) Close()
- func (r *RequestHandler) GetClientTLSConfig() tls.Config
- func (r *RequestHandler) GetDevices(req *pb.GetDevicesRequest, srv pb.GrpcGateway_GetDevicesServer) error
- func (r *RequestHandler) GetResourceLinks(req *pb.GetResourceLinksRequest, srv pb.GrpcGateway_GetResourceLinksServer) error
- func (r *RequestHandler) RetrieveResourceFromDevice(ctx context.Context, req *pb.RetrieveResourceFromDeviceRequest) (*pb.RetrieveResourceFromDeviceResponse, error)
- func (r *RequestHandler) RetrieveResourcesValues(req *pb.RetrieveResourcesValuesRequest, ...) error
- func (r *RequestHandler) SubscribeForEvents(srv pb.GrpcGateway_SubscribeForEventsServer) error
- func (r *RequestHandler) UpdateResourcesValues(ctx context.Context, req *pb.UpdateResourceValuesRequest) (*pb.UpdateResourceValuesResponse, error)
- type SendEventFunc
- type Subscriber
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddHandler ¶
func AddHandler(svr *kitNetGrpc.Server, config HandlerConfig, clientTLS tls.Config) error
func GrpcResourceID2ResourceID ¶
func GrpcResourceID2ResourceID(resourceId *pb.ResourceId) string
func NewDeviceSubscription ¶
func NewDeviceSubscription(id, userID string, send SendEventFunc, resourceProjection *projectionRA.Projection, deviceEvent *pb.SubscribeForEvents_DeviceEventFilter) *deviceSubscription
func NewDevicesSubscription ¶
func NewDevicesSubscription(id, userID string, send SendEventFunc, resourceProjection *projectionRA.Projection, devicesEvent *pb.SubscribeForEvents_DevicesEventFilter) *devicesSubscription
func NewResourceCtx ¶
func NewResourceCtx(subscriptions *subscriptions, updateNotificationContainer *notification.UpdateNotificationContainer, retrieveNotificationContainer *notification.RetrieveNotificationContainer) func(context.Context) (eventstore.Model, error)
func NewResourceSubscription ¶
func NewResourceSubscription(id, userID string, send SendEventFunc, resourceProjection *projectionRA.Projection, resourceEvent *pb.SubscribeForEvents_ResourceEventFilter) *resourceSubscription
func NewSubscription ¶
func NewSubscription(userID, id string, send SendEventFunc, resourceProjection *projectionRA.Projection) *subscription
func NewSubscriptions ¶
func NewSubscriptions() *subscriptions
func Register ¶
func Register(server *grpc.Server, handler *RequestHandler)
Register registers the handler instance with a gRPC server.
Types ¶
type Config ¶
type Config struct { grpc.Config OAuth manager.Config `envconfig:"OAUTH"` AuthServerAddr string `envconfig:"AUTH_SERVER_ADDRESS" default:"127.0.0.1:9100"` ResourceAggregateAddr string `envconfig:"RESOURCE_AGGREGATE_ADDRESS" default:"127.0.0.1:9100"` ResourceDirectoryAddr string `envconfig:"RESOURCE_DIRECTORY_ADDRESS" default:"127.0.0.1:9100"` FQDN string `envconfig:"FQDN" default:"grpcgw.ocf.cloud"` TimeoutForRequests time.Duration `envconfig:"TIMEOUT_FOR_REQUESTS" default:"10s"` }
Config represent application configuration
type HandlerConfig ¶
type HandlerConfig struct { Mongo mongodb.Config Nats nats.Config Service Config GoRoutinePoolSize int `envconfig:"GOROUTINE_POOL_SIZE" default:"16"` UserDevicesManagerTickFrequency time.Duration `envconfig:"USER_MGMT_TICK_FREQUENCY" default:"15s"` UserDevicesManagerExpiration time.Duration `envconfig:"USER_MGMT_EXPIRATION" default:"1m"` }
type RequestHandler ¶
type RequestHandler struct {
// contains filtered or unexported fields
}
RequestHandler handles incoming requests.
func NewRequestHandler ¶
func NewRequestHandler( authServiceClient pbAS.AuthorizationServiceClient, deviceDirectoryClient pbDD.DeviceDirectoryClient, resourceDirectoryClient pbRD.ResourceDirectoryClient, resourceShadowClient pbRS.ResourceShadowClient, resourceAggregateClient pbRA.ResourceAggregateClient, resourceProjection *projectionRA.Projection, subscriptions *subscriptions, updateNotificationContainer *notification.UpdateNotificationContainer, retrieveNotificationContainer *notification.RetrieveNotificationContainer, timeoutForRequests time.Duration, closeFunc func(), ) *RequestHandler
NewRequestHandler factory for new RequestHandler.
func NewRequestHandlerFromConfig ¶
func NewRequestHandlerFromConfig(config HandlerConfig, clientTLS tls.Config) (*RequestHandler, error)
func (*RequestHandler) Close ¶
func (r *RequestHandler) Close()
func (*RequestHandler) GetClientTLSConfig ¶
func (r *RequestHandler) GetClientTLSConfig() tls.Config
func (*RequestHandler) GetDevices ¶
func (r *RequestHandler) GetDevices(req *pb.GetDevicesRequest, srv pb.GrpcGateway_GetDevicesServer) error
func (*RequestHandler) GetResourceLinks ¶
func (r *RequestHandler) GetResourceLinks(req *pb.GetResourceLinksRequest, srv pb.GrpcGateway_GetResourceLinksServer) error
func (*RequestHandler) RetrieveResourceFromDevice ¶
func (r *RequestHandler) RetrieveResourceFromDevice(ctx context.Context, req *pb.RetrieveResourceFromDeviceRequest) (*pb.RetrieveResourceFromDeviceResponse, error)
func (*RequestHandler) RetrieveResourcesValues ¶
func (r *RequestHandler) RetrieveResourcesValues(req *pb.RetrieveResourcesValuesRequest, srv pb.GrpcGateway_RetrieveResourcesValuesServer) error
func (*RequestHandler) SubscribeForEvents ¶
func (r *RequestHandler) SubscribeForEvents(srv pb.GrpcGateway_SubscribeForEventsServer) error
func (*RequestHandler) UpdateResourcesValues ¶
func (r *RequestHandler) UpdateResourcesValues(ctx context.Context, req *pb.UpdateResourceValuesRequest) (*pb.UpdateResourceValuesResponse, error)
Click to show internal directories.
Click to hide internal directories.