service

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAggregate

func NewAggregate(ctx context.Context, resourceId string, isUserDeviceFunc isUserDeviceFunc, SnapshotThreshold int, eventstore EventStore, retry cqrs.RetryFunc) (*aggregate, error)

NewAggregate creates new resource aggreate - it must be created for every run command.

func NewAuth

func NewAuth(jwksUrl string, tls *tls.Config) kitNetGrpc.AuthInterceptors

Types

type ClientCertManager

type ClientCertManager = interface {
	GetClientTLSConfig() *tls.Config
}

type Config

type Config struct {
	grpc.Config
	AuthServerAddr                  string         `envconfig:"AUTH_SERVER_ADDRESS" default:"127.0.0.1:9100"`
	SnapshotThreshold               int            `envconfig:"SNAPSHOT_THRESHOLD" default:"128"`
	ConcurrencyExceptionMaxRetry    int            `envconfig:"OCC_MAX_RETRY" default:"8"`
	JwksURL                         string         `envconfig:"JWKS_URL"`
	OAuth                           manager.Config `envconfig:"OAUTH"`
	UserDevicesManagerTickFrequency time.Duration  `envconfig:"USER_MGMT_TICK_FREQUENCY" default:"15s"`
	UserDevicesManagerExpiration    time.Duration  `envconfig:"USER_MGMT_EXPIRATION" default:"1m"`
}

Config represent application configuration

func (Config) String

func (c Config) String() string

String return string representation of Config

type EventStore

type EventStore interface {
	cqrsEventStore.EventStore
	cqrsMaintenance.EventStore
	GetInstanceId(ctx context.Context, resourceId string) (int64, error)
	RemoveInstanceId(ctx context.Context, instanceId int64) error
}

type LogPublishErrFunc

type LogPublishErrFunc func(err error)

type RequestHandler

type RequestHandler struct {
	// contains filtered or unexported fields
}

RequestHandler for handling incoming request

func NewRequestHandler

func NewRequestHandler(config Config, eventstore EventStore, publisher cqrsEventBus.Publisher, isUserDeviceFunc isUserDeviceFunc) *RequestHandler

NewRequestHandler factory for new RequestHandler

func (RequestHandler) ConfirmResourceDelete added in v1.1.0

func (RequestHandler) ConfirmResourceRetrieve

func (RequestHandler) ConfirmResourceUpdate

func (RequestHandler) DeleteResource added in v1.1.0

func (RequestHandler) NotifyResourceChanged

func (RequestHandler) PublishResource

func (RequestHandler) RetrieveResource

func (RequestHandler) UnpublishResource

func (RequestHandler) UpdateResource

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server handle HTTP request

func New

func New(config Config, clientCertManager ClientCertManager, serverCertManager ServerCertManager, eventStore EventStore, publisher cqrsEventBus.Publisher) *Server

New creates new Server with provided store and publisher.

func (*Server) Serve

func (s *Server) Serve() error

Serve serve starts the service's HTTP server and blocks.

func (*Server) Shutdown

func (s *Server) Shutdown()

Shutdown ends serving

type ServerCertManager

type ServerCertManager = interface {
	GetServerTLSConfig() *tls.Config
}

Jump to

Keyboard shortcuts

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