conf

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBConn

func DBConn() *gorm.DB

func DBConnWithLoglevel added in v0.0.3

func DBConnWithLoglevel(logMode logger.LogLevel) *gorm.DB

func GetAccessToken

func GetAccessToken() string

func GetDatabaseConnectionURL

func GetDatabaseConnectionURL() string

func GetEvmRpcConfig

func GetEvmRpcConfig() config.Config

func GetGormConfig

func GetGormConfig() *gorm.Config

func GetNotifyEndPoint

func GetNotifyEndPoint() string

func GetRedisConnectionURL

func GetRedisConnectionURL() string

func RedisConn

func RedisConn() *redis.Client

Types

type Configuration

type Configuration struct {
	Database     DatabaseConfiguration       `mapstructure:",squash"`
	Redis        RedisConfiguration          `mapstructure:",squash"`
	Notify       NotificationConfiguration   `mapstructure:",squash"`
	EvmRpc       EvmRpcEndpointConfiguration `mapstructure:",squash"`
	Kafka        KafkaConfiguration          `mapstructure:",squash"`
	TestSC       SCInfo                      `mapstructure:",squash"`
	AppName      string                      `mapstructure:"APP_NAME"`
	AppAddr      string                      `mapstructure:"APP_ADDR"`
	ConfigFile   string                      `mapstructure:"CONFIG_FILE"`
	DbUrl        string                      `mapstructure:"DB_URL"`
	Env          string                      `mapstructure:"ENV"`
	CouponSecret string                      `mapstructure:"COUPON_SECRET"`
}

func GetConfiguration

func GetConfiguration() *Configuration

type DatabaseConfiguration

type DatabaseConfiguration struct {
	DbUser     string `mapstructure:"DB_USER"`
	DbPassword string `mapstructure:"DB_PASSWORD"`
	DbHost     string `mapstructure:"DB_HOST"`
	DbPort     string `mapstructure:"DB_PORT"`
	DbName     string `mapstructure:"DB_NAME"`
}

type EvmRpcEndpointConfiguration

type EvmRpcEndpointConfiguration struct {
	ChainID       string `mapstructure:"CHAIN_ID"`
	EVMChainID    int    `mapstructure:"EVM_CHAIN_ID"`
	EndPoint      string `mapstructure:"EVMRPC_ENDPOINT"`
	PrefixAddress string `mapstructure:"PREFIX_ADDRESS"`
	TokenSymbol   string `mapstructure:"TOKEN_SYMBOL"`
}

type KafkaConfiguration

type KafkaConfiguration struct {
	KafkaURL string `mapstructure:"KAFKA_URL" yaml:"kafkaUrl" toml:"kafkaUrl" xml:"kafkaUrl" json:"kafkaUrl,omitempty"`
	User     string `mapstructure:"KAFKA_USER" yaml:"user" toml:"user" xml:"user" json:"user,omitempty"`
	Password string `mapstructure:"KAFKA_PASSWORD" yaml:"password" toml:"password" xml:"password" json:"password,omitempty"`
}

type NotificationConfiguration

type NotificationConfiguration struct {
	EndPoint         string `mapstructure:"NOTIFY_ENDPOINT"`
	AccessToken      string `mapstructure:"ACCESS_TOKEN"`
	FrontendClaimURL string `mapstructure:"FE_CLAIM_URL"`
}

type RedisConfiguration

type RedisConfiguration struct {
	RedisAddress string `mapstructure:"REDIS_ADDRESS"`
	RedisTtl     string `mapstructure:"REDIS_TTL"`
}

type SCInfo

type SCInfo struct {
	SCAddress string `mapstructure:"TEST_SC_ADDR"`
	SCPK      string `mapstructure:"TEST_SC_PK"`
}

Jump to

Keyboard shortcuts

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