api

package
v0.3.1-0...-684a909 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitFromConfig

func InitFromConfig(ctx context.Context, api *API, cfg *Config) error

nolint: funlen

Types

type API

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

func (*API) Close

func (api *API) Close(ctx context.Context)

func (*API) InitFromCli

func (api *API) InitFromCli(ctx context.Context, c *cli.Context) error

func (*API) Name

func (api *API) Name() string

func (*API) Start

func (api *API) Start() error

type Config

type Config struct {
	// db configs
	DatabaseUsername        string
	DatabasePassword        string
	DatabaseName            string
	DatabaseHost            string
	DatabaseMaxIdleConns    uint64
	DatabaseMaxOpenConns    uint64
	DatabaseMaxConnLifetime uint64
	RPCUrl                  string
	HTTPPort                uint64
	MetricsHTTPPort         uint64
	ETHClientTimeout        uint64
	CORSOrigins             []string
	OpenDBFunc              func() (db.DB, error)
}

func NewConfigFromCliContext

func NewConfigFromCliContext(c *cli.Context) (*Config, error)

NewConfigFromCliContext creates a new config instance from command line flags.

Jump to

Keyboard shortcuts

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