Back to

Package huner

Latest Go to latest

The highest tagged major version is .

Published: Oct 8, 2020 | License: MIT | Module:



const Version = "v1.0.0"

Version is the package current version.

func EnvKeysPrefix

func EnvKeysPrefix() string

func Environment

func Environment(prefix string) string

func GRPCConn

func GRPCConn(serverAddr string, cei hexa.ContextExporterImporter) (*grpc.ClientConn, error)

GRPCConn returns new instance of the gRPC connection with your config to use in client

func GetConfigFilePaths

func GetConfigFilePaths(o ConfigFilePahtsOpts) []string

GetConfigFilePaths generates config path as follow: - /etc/{project}/{configFile.configExtension} - /etc/{project}/{microservice.configExtension} - /etc/{project_root_path}/{configFile.configExtension} - /etc/{project_root_path}/.env - /etc/{project_root_path}/.{environment}.env

func MustGRPCConn

func MustGRPCConn(serverAddr string, cei hexa.ContextExporterImporter) *grpc.ClientConn

Must returns new instance of the gRPC connection with your config to use in client it will panic any error.

func NewFaktoryJobsDriver

func NewFaktoryJobsDriver(ctxExporterImporter hexa.ContextExporterImporter, poolSize int) (hjob.Jobs, error)

NewFaktoryJobsDriver generate new faktory driver for hexa jobs.

func NewFaktoryWorkersDriver

func NewFaktoryWorkersDriver(ctxExporterImporter hexa.ContextExporterImporter, concurrency int) (hjob.Worker, error)

NewFaktoryWorkerDriver generate new faktory driver for the hexa worker.

func NewTranslator

func NewTranslator(pathPrefix string, cfg TranslateOpts) hexa.Translator

return new translator service.

func NewViperConfigDriver

func NewViperConfigDriver(envPrefix string, files []string) (hexa.Config, error)

NewViperConfigDriver returns new instance of the viper driver for hexa config

func TuneEcho

func TuneEcho(e *echo.Echo, cfg EchoConfigs, o EchoTunerOptions)

TuneEcho tune echo framework.

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

type BaseServiceContainer

type BaseServiceContainer interface {
	SetConfig(config hexa.Config)
	SetLogger(logger hexa.Logger)
	SetTranslator(translator hexa.Translator)
	SetJobs(jobs hjob.Jobs)
	SetEmitter(emitter hevent.Emitter)
	Config() hexa.Config
	Logger() hexa.Logger
	Translator() hexa.Translator
	Jobs() hjob.Jobs
	Emitter() hevent.Emitter

BaseServiceContainer is the base service container to use in each microservice.

func NewBaseServiceContainer

func NewBaseServiceContainer(must bool) BaseServiceContainer

NewBaseServiceContainer returns new instance of the BaseServiceContainer.

type ConfigFilePahtsOpts

type ConfigFilePahtsOpts struct {
	Project       string // e.g., senna
	Microservice  string // e.g., order
	ProjectRoot   string // e.g., /home/mehran/senna/order
	FileName      string // e.g., config
	FileExtension string // e.g., json or yaml
	Environment   string // (optional) e.g., staging

type EchoConfigs

type EchoConfigs struct {
	JWTConfig                middleware.JWTConfig
	JwtClaimAuthorizerConfig hecho.JwtClaimAuthorizerConfig
	Debug                    bool
	EchoLogLevel             string
	AllowOrigins             []string
	AllowHeaders             []string
	AllowMethods             []string

type EchoTunerOptions

type EchoTunerOptions struct {
	Logger     hexa.Logger
	Translator hexa.Translator
	UserFinder hecho.UserFinderBySub
	UserSDK    hexa.UserSDK
	CtxCreator hecho.CtxCreator

type GRPCConfigs

type GRPCConfigs struct {
	Secret       string
	Debug        bool
	GRPCLogLevel int `json:"log_level" yaml:"log_level"`

type GRPCServerTunerOptions

type GRPCServerTunerOptions struct {
	ContextEI  hexa.ContextExporterImporter
	Logger     hexa.Logger
	Translator hexa.Translator

GRPCServerTunerOptions contains options needed to tune a gRPC server

type TranslateOpts

type TranslateOpts struct {
	Files         []string
	FallbackLangs []string

type TunerOptions

type TunerOptions struct {
	IsDebug bool

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier