service

package
v2.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, config Config, fileWatcher *fsnotify.Watcher, logger log.Logger) (*service.Service, error)

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 {
	IdentityStore          IdentityStoreConfig `yaml:"identityStore" json:"identityStore"`
	Eventbus               EventBusConfig      `yaml:"eventBus" json:"eventBus"`
	ResourceAggregate      GrpcServerConfig    `yaml:"resourceAggregate" json:"resourceAggregate"`
	ResourceDirectory      GrpcServerConfig    `yaml:"resourceDirectory" json:"resourceDirectory"`
	CertificateAuthority   GrpcServerConfig    `yaml:"certificateAuthority" json:"certificateAuthority"`
	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"`
}

func (Config) String

func (c Config) String() string

String return string representation of Config

func (*Config) Validate

func (c *Config) Validate() 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 GRPCConfig

type GRPCConfig struct {
	OwnerCacheExpiration   time.Duration `yaml:"ownerCacheExpiration" json:"ownerCacheExpiration"`
	SubscriptionBufferSize int           `yaml:"subscriptionBufferSize" json:"subscriptionBufferSize"`
	server.Config          `yaml:",inline" json:",inline"`
}

func (*GRPCConfig) Validate

func (c *GRPCConfig) Validate() error

type GrpcServerConfig

type GrpcServerConfig struct {
	Connection client.Config `yaml:"grpc" json:"grpc"`
}

func (*GrpcServerConfig) Validate

func (c *GrpcServerConfig) Validate() error

type IdentityStoreConfig

type IdentityStoreConfig struct {
	Connection client.Config `yaml:"grpc" json:"grpc"`
}

func (*IdentityStoreConfig) Validate

func (c *IdentityStoreConfig) Validate() error

type RequestHandler

type RequestHandler struct {
	pb.UnimplementedGrpcGatewayServer
	// contains filtered or unexported fields
}

RequestHandler handles incoming requests.

func NewRequestHandlerFromConfig

func NewRequestHandlerFromConfig(ctx context.Context, config Config, fileWatcher *fsnotify.Watcher, logger log.Logger, tracerProvider trace.TracerProvider, goroutinePoolGo func(func()) error) (*RequestHandler, error)

func (*RequestHandler) CancelPendingCommands

func (*RequestHandler) CancelPendingMetadataUpdates

func (*RequestHandler) Close

func (r *RequestHandler) Close()

func (*RequestHandler) CreateResource

func (*RequestHandler) DeleteDevices

func (*RequestHandler) DeleteResource

func (*RequestHandler) GetDevices

func (*RequestHandler) GetDevicesMetadata

func (*RequestHandler) GetEvents

func (*RequestHandler) GetHubConfiguration

func (*RequestHandler) GetPendingCommands

func (*RequestHandler) GetResourceFromDevice

func (*RequestHandler) GetResources

func (*RequestHandler) SubscribeToEvents

func (r *RequestHandler) SubscribeToEvents(srv pb.GrpcGateway_SubscribeToEventsServer) (errRet error)

func (*RequestHandler) UpdateDeviceMetadata

func (*RequestHandler) UpdateResource

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL