Documentation ¶
Index ¶
- Constants
- func EnvKeysPrefix() string
- func Environment(prefix string) string
- func GRPCConn(o GrpcConnOptions) (*grpc.ClientConn, error)
- func GetConfigFilePaths(o ConfigFilePathsOpts) []string
- func MustGRPCConn(o GrpcConnOptions) *grpc.ClientConn
- func NewFaktoryJobsDriver(propagator hexa.ContextPropagator, poolSize int) (hjob.Jobs, error)
- func NewFaktoryWorkersDriver(p hexa.ContextPropagator, concurrency int) (hjob.Worker, error)
- func NewTranslator(pathPrefix string, cfg TranslateOpts) hexa.Translator
- func NewViperConfigDriver(envPrefix string, files []string) (hexa.Config, error)
- func TuneGRPCServer(cfg GRPCConfigs, o GRPCServerTunerOptions) (*grpc.Server, error)
- type BaseServiceContainer
- type ConfigFilePathsOpts
- type GRPCConfigs
- type GRPCServerTunerOptions
- type GrpcConnOptions
- type TranslateOpts
- type TunerOptions
Constants ¶
const Version = "v1.0.0"
Version is the package current version.
Variables ¶
This section is empty.
Functions ¶
func EnvKeysPrefix ¶
func EnvKeysPrefix() string
func Environment ¶
func GRPCConn ¶
func GRPCConn(o GrpcConnOptions) (*grpc.ClientConn, error)
GRPCConn returns new instance of the gRPC connection with your config to use in client
func GetConfigFilePaths ¶
func GetConfigFilePaths(o ConfigFilePathsOpts) []string
GetConfigFilePaths generates config path as follow: - /etc/{appName}/{configFile.configExtension} - /etc/{appName}/{serviceName.configExtension} - {HomePath}/{configFile.configExtension} - {HomePath}/.env - {HomePath}/.{environment}.env
func MustGRPCConn ¶
func MustGRPCConn(o GrpcConnOptions) *grpc.ClientConn
MustGRPCConn returns new instance of the gRPC connection with your config to use in client or will panic if occurred any error.
func NewFaktoryJobsDriver ¶
func NewFaktoryJobsDriver(propagator hexa.ContextPropagator, poolSize int) (hjob.Jobs, error)
NewFaktoryJobsDriver generate new faktory driver for hexa jobs.
func NewFaktoryWorkersDriver ¶
func NewFaktoryWorkersDriver(p hexa.ContextPropagator, concurrency int) (hjob.Worker, error)
NewFaktoryWorkersDriver generate new faktory driver for the hexa worker.
func NewTranslator ¶
func NewTranslator(pathPrefix string, cfg TranslateOpts) hexa.Translator
return new translator service.
func NewViperConfigDriver ¶
NewViperConfigDriver returns new instance of the viper driver for hexa config
func TuneGRPCServer ¶
func TuneGRPCServer(cfg GRPCConfigs, o GRPCServerTunerOptions) (*grpc.Server, error)
TuneGRPCServer returns new instance of the tuned gRPC Server to server requests to services
Types ¶
type BaseServiceContainer ¶
type BaseServiceContainer interface { SetConfig(config hexa.Config) SetLogger(logger hlog.Logger) SetTranslator(translator hexa.Translator) SetProbeServer(server probe.Server) SetHealthReporter(reporter hexa.HealthReporter) SetJobs(jobs hjob.Jobs) SetEmitter(emitter hevent.Emitter) SetArranger(arranger arranger.Arranger) SetDLM(dlm hexa.DLM) SetOpenTelemetry(otlm htel.OpenTelemetry) Config() hexa.Config Logger() hlog.Logger Translator() hexa.Translator ProbeServer() probe.Server HealthReporter() hexa.HealthReporter Jobs() hjob.Jobs Emitter() hevent.Emitter Arranger() arranger.Arranger DLM() hexa.DLM OpenTelemetry() htel.OpenTelemetry }
BaseServiceContainer is the base service container to use in each microservice.
func NewBaseServiceContainer ¶
func NewBaseServiceContainer() BaseServiceContainer
NewBaseServiceContainer returns new instance of the BaseServiceContainer.
type ConfigFilePathsOpts ¶
type GRPCConfigs ¶
type GRPCServerTunerOptions ¶
type GRPCServerTunerOptions struct { ContextPropagator hexa.ContextPropagator Logger hlog.Logger Translator hexa.Translator MetricsOpts hrpc.MetricsOptions TracingOpts []otelgrpc.Option }
GRPCServerTunerOptions contains options needed to tune a gRPC server
type GrpcConnOptions ¶
type GrpcConnOptions struct { Addr string Propagator hexa.ContextPropagator TracingOpts []otelgrpc.Option }
func (*GrpcConnOptions) WithAddr ¶
func (o *GrpcConnOptions) WithAddr(addr string) GrpcConnOptions
WithAddr returns a new grpc config with the new address.
type TranslateOpts ¶
type TunerOptions ¶
type TunerOptions struct {
IsDebug bool
}