app

package
v0.2.3-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: MIT Imports: 51 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FmtCannotStart = "cannot start %q"
)

Variables

View Source
var (
	ErrStartTimeout    = errors.New("start timeout")
	ErrShutdownTimeout = errors.New("shutdown timeout")
)

Functions

func MakeEncodingConfig

func MakeEncodingConfig() (codec.Codec, *codec.AminoCodec)

MakeEncodingConfig creates an EncodingConfig to properly handle and marshal all messages

func MakeSdkConfig

func MakeSdkConfig(cfg Config, sdkConfig *sdk.Config)

MakeSdkConfig represents a handy implementation of SdkConfigSetup that simply setups the prefix inside the configuration

Types

type App

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

func New

func New(cfg Config, l zerolog.Logger) *App

func (*App) GetStartTimeout

func (a *App) GetStartTimeout() time.Duration

func (*App) GetStopTimeout

func (a *App) GetStopTimeout() time.Duration

func (*App) Start

func (a *App) Start(ctx context.Context) error

func (*App) Stop

func (a *App) Stop(ctx context.Context) error

type Config

type Config struct {
	ChainPrefix    string `env:"CHAIN_PREFIX"`
	LogLevel       string `env:"LOG_LEVEL" envDefault:"info"`
	Server         server.Config
	Modules        []string `env:"MODULES" required:"true"`
	GRPCConfig     grpc.Config
	RPCConfig      rpc.Config
	BrokerConfig   broker.Config
	StorageConfig  storage.Config
	WorkerConfig   worker.Config
	StartTimeout   time.Duration `env:"START_TIMEOUT"`
	StopTimeout    time.Duration `env:"STOP_TIMEOUT"`
	ParseAvatarURL bool          `env:"PARSE_AVATAR_URL" envDefault:"false"`
}

Jump to

Keyboard shortcuts

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