Documentation ¶
Index ¶
- func AddHandler(svr *kitNetGrpc.Server, config HandlerConfig, clientTLS *tls.Config) error
- func NewDeviceSubscription(id, userID string, send SendEventFunc, resourceProjection *Projection, ...) *deviceSubscription
- func NewDevicesSubscription(id, userID string, send SendEventFunc, resourceProjection *Projection, ...) *devicesSubscription
- func NewResourceCtx(subscriptions *subscriptions, ...) func(context.Context) (eventstore.Model, error)
- func NewResourceSubscription(id, userID string, send SendEventFunc, resourceProjection *Projection, ...) *resourceSubscription
- func NewSubscription(userID, id string, send SendEventFunc, resourceProjection *Projection) *subscription
- func NewSubscriptions() *subscriptions
- func Register(server *grpc.Server, handler *RequestHandler)
- type ClientCfg
- type Config
- type Device
- type DeviceDirectory
- type DeviceIDVersion
- type HandlerConfig
- type Projection
- type RequestHandler
- func (r *RequestHandler) Close()
- func (r *RequestHandler) DeleteResource(ctx context.Context, req *pb.DeleteResourceRequest) (*pb.DeleteResourceResponse, error)
- func (r *RequestHandler) GetClientConfiguration(context.Context, *pb.ClientConfigurationRequest) (*pb.ClientConfigurationResponse, error)
- 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 ResourceDirectory
- type ResourceLink
- type ResourceShadow
- 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 NewDeviceSubscription ¶
func NewDeviceSubscription(id, userID string, send SendEventFunc, resourceProjection *Projection, deviceEvent *pb.SubscribeForEvents_DeviceEventFilter) *deviceSubscription
func NewDevicesSubscription ¶
func NewDevicesSubscription(id, userID string, send SendEventFunc, resourceProjection *Projection, devicesEvent *pb.SubscribeForEvents_DevicesEventFilter) *devicesSubscription
func NewResourceCtx ¶
func NewResourceCtx(subscriptions *subscriptions, updateNotificationContainer *notification.UpdateNotificationContainer, retrieveNotificationContainer *notification.RetrieveNotificationContainer, deleteNotificationContainer *notification.DeleteNotificationContainer) func(context.Context) (eventstore.Model, error)
func NewResourceSubscription ¶
func NewResourceSubscription(id, userID string, send SendEventFunc, resourceProjection *Projection, resourceEvent *pb.SubscribeForEvents_ResourceEventFilter) *resourceSubscription
func NewSubscription ¶
func NewSubscription(userID, id string, send SendEventFunc, resourceProjection *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 ClientCfg ¶
type ClientCfg struct { pb.ClientConfigurationResponse CloudCAPool string `envconfig:"CLOUD_CA_POOL" env:"CLOUD_CA_POOL" long:"cloud-ca" description:"file path to the root certificate in PEM format"` }
type Config ¶
type Config struct { 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"` FQDN string `envconfig:"FQDN" default:"grpcgw.ocf.cloud"` TimeoutForRequests time.Duration `envconfig:"TIMEOUT_FOR_REQUESTS" default:"10s"` ClientConfiguration ClientCfg `envconfig:"CLIENT_CONFIGURATION"` ProjectionCacheExpiration time.Duration `envconfig:"PROJECTION_CACHE_EXPIRATION" default:"1m"` }
Config represent application configuration
type Device ¶
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)
GetDevices provides list state of devices.
type DeviceIDVersion ¶
type DeviceIDVersion struct {
// contains filtered or unexported fields
}
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 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) GetResourceCtxs ¶
func (p *Projection) GetResourceCtxs(ctx context.Context, resourceIDsFilter []*pb.ResourceId, typeFilter, deviceIDs strings.Set) (map[string]map[string]*resourceCtx, error)
type RequestHandler ¶
type RequestHandler struct {
// contains filtered or unexported fields
}
RequestHandler handles incoming requests.
func NewRequestHandler ¶
func NewRequestHandler( authServiceClient pbAS.AuthorizationServiceClient, resourceAggregateClient pbRA.ResourceAggregateClient, resourceProjection *Projection, subscriptions *subscriptions, updateNotificationContainer *notification.UpdateNotificationContainer, retrieveNotificationContainer *notification.RetrieveNotificationContainer, deleteNotificationContainer *notification.DeleteNotificationContainer, timeoutForRequests time.Duration, closeFunc func(), clientConfiguration pb.ClientConfigurationResponse, userDevicesManager *clientAS.UserDevicesManager, fqdn string, ) *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) DeleteResource ¶ added in v1.1.0
func (r *RequestHandler) DeleteResource(ctx context.Context, req *pb.DeleteResourceRequest) (*pb.DeleteResourceResponse, error)
func (*RequestHandler) GetClientConfiguration ¶
func (r *RequestHandler) GetClientConfiguration(context.Context, *pb.ClientConfigurationRequest) (*pb.ClientConfigurationResponse, error)
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)
type ResourceDirectory ¶
type ResourceDirectory struct {
// contains filtered or unexported fields
}
func New ¶
func New(projection *Projection, deviceIds []string) *ResourceDirectory
func (*ResourceDirectory) GetResourceLinks ¶
func (rd *ResourceDirectory) GetResourceLinks(in *pb.GetResourceLinksRequest, srv pb.GrpcGateway_GetResourceLinksServer) error
type ResourceLink ¶
type ResourceLink struct {
// contains filtered or unexported fields
}
type ResourceShadow ¶
type ResourceShadow struct {
// contains filtered or unexported fields
}
func NewResourceShadow ¶
func NewResourceShadow(projection *Projection, deviceIds []string) *ResourceShadow
func (*ResourceShadow) RetrieveResourcesValues ¶
func (rd *ResourceShadow) RetrieveResourcesValues(req *pb.RetrieveResourcesValuesRequest, srv pb.GrpcGateway_RetrieveResourcesValuesServer) error
Source Files ¶
- config.go
- deleteResource.go
- deviceDirectory.go
- deviceSubscription.go
- devicesSubscription.go
- getClientConfiguration.go
- getDevices.go
- getResourceLinks.go
- grpcApi.go
- projection.go
- resourceCtx.go
- resourceDirectory.go
- resourceShadow.go
- resourceSubscription.go
- retrieveResourceFromDevice.go
- retrieveResourcesValues.go
- subscription.go
- subscriptions.go
- updateResourceValues.go
Click to show internal directories.
Click to hide internal directories.