Documentation
¶
Index ¶
- func ConfigureBahamut(ctx context.Context, cfg any, pubsub bahamut.PubSubClient, ...) (opts []bahamut.Option)
- func ConfigureMaxProc(overrideMax int)
- func ErrorTransformer(err error) error
- func MakeA3SManipulator(ctx context.Context, a3sConfig conf.A3SClientConf) (manipulate.Manipulator, error)
- func MakeBahamutGatewayNotifier(ctx context.Context, pubsub bahamut.PubSubClient, serviceName string, ...) []bahamut.Option
- func MakeIdentifiableRetriever(manipulator manipulate.Manipulator, apiManager elemental.ModelManager) bahamut.IdentifiableRetriever
- func MakeMongoManipulator(cfg conf.MongoConf, hasher sharder.Hasher, ...) manipulate.TransactionalManipulator
- func MakeNATSClient(cfg conf.NATSConf) bahamut.PubSubClient
- func MakeNATSServer(cfg *conf.NATSConf) (*natsserver.Server, error)
- func MakePublishHandler(excludedIdentities []elemental.Identity) bahamut.PushPublishHandler
- type CloseRecorderHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureBahamut ¶
func ConfigureBahamut( ctx context.Context, cfg any, pubsub bahamut.PubSubClient, apiManager elemental.ModelManager, healthHandler bahamut.HealthServerFunc, requestAuthenticators []bahamut.RequestAuthenticator, sessionAuthenticators []bahamut.SessionAuthenticator, authorizers []bahamut.Authorizer, ) (opts []bahamut.Option)
ConfigureBahamut returns a list of bahamut.Option based on provided configuration.
func ConfigureMaxProc ¶
func ConfigureMaxProc(overrideMax int)
ConfigureMaxProc configures the program's GOMAXPROCS to the given value if not 0. If 0, the default GOMAXPROCS will be used.
func ErrorTransformer ¶
ErrorTransformer transforms a disconnected error into an not acceptable. This avoid 500 errors due to clients being disconnected.
func MakeA3SManipulator ¶
func MakeA3SManipulator(ctx context.Context, a3sConfig conf.A3SClientConf) (manipulate.Manipulator, error)
MakeA3SManipulator returns an HTTP manipulator for a3s communication.
func MakeBahamutGatewayNotifier ¶
func MakeBahamutGatewayNotifier( ctx context.Context, pubsub bahamut.PubSubClient, serviceName string, gatewayTopic string, anouncedAddress string, nopts ...push.NotifierOption, ) []bahamut.Option
MakeBahamutGatewayNotifier returns the bahamut options needed to make A3S announce itself to a bahamut gateway.
func MakeIdentifiableRetriever ¶
func MakeIdentifiableRetriever( manipulator manipulate.Manipulator, apiManager elemental.ModelManager, ) bahamut.IdentifiableRetriever
MakeIdentifiableRetriever returns a bahamut.IdentifiableRetriever to handle patches as classic update.
func MakeMongoManipulator ¶
func MakeMongoManipulator(cfg conf.MongoConf, hasher sharder.Hasher, additionalOptions ...manipmongo.Option) manipulate.TransactionalManipulator
MakeMongoManipulator returns a configured mongo manipulator. This function is not meant to be used outside of the platform. It will fatal anytime it feels like it.
func MakeNATSClient ¶
func MakeNATSClient(cfg conf.NATSConf) bahamut.PubSubClient
MakeNATSClient returns a connected pubsub server client. This function is not meant to be used outside of the platform. It will fatal anytime it feels like it.
func MakeNATSServer ¶ added in v0.4.0
func MakeNATSServer(cfg *conf.NATSConf) (*natsserver.Server, error)
MakeNATSServer returns an embded nats server. It uses the provide conf.NATSConf to configure everything needed. This function WILL change the provided NATSConf so it can be used with the generated NATS server. Basically, fields in NATSConf related to server connection will be either ignored or replaced.
func MakePublishHandler ¶
func MakePublishHandler(excludedIdentities []elemental.Identity) bahamut.PushPublishHandler
MakePublishHandler returns a bahamut.PushPublishHandler that publishes all events but the ones related to the given identities.
Types ¶
type CloseRecorderHandler ¶
type CloseRecorderHandler func()
CloseRecorderHandler is the type of recorder closer handler
func ConfigureLogger ¶
func ConfigureLogger(serviceName string, cfg conf.LoggingConf) CloseRecorderHandler
ConfigureLogger configures the logging subsystem.
func ConfigureTracerWithURL ¶
func ConfigureTracerWithURL(tracerURL string, serviceName string) (CloseRecorderHandler, error)
ConfigureTracerWithURL returns a jaeger backed opentracing tracer from an URL.