bootstrap

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureBahamut

func ConfigureBahamut(
	ctx context.Context,
	cfg interface{},
	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

func ErrorTransformer(err error) error

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 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.

Jump to

Keyboard shortcuts

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