config

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: AGPL-3.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arbitrum added in v0.4.0

type Arbitrum struct {
	BlockchainID    string `yaml:"arbitrum_chain_id" envconfig:"ARBITRUM_CHAIN_ID"`
	MOMTokenAddress string `yaml:"arbitrum_mom_token_address" envconfig:"ARBITRUM_MOM_TOKEN_ADDRESS"`
	DADTokenAddress string `yaml:"arbitrum_dad_token_address" envconfig:"ARBITRUM_DAD_TOKEN_ADDRESS"`
	StakeAddress    string `yaml:"arbitrum_stake_token_address" envconfig:"ARBITRUM_STAKE_ADDRESS"`
	NFTAddress      string `yaml:"arbitrum_nft_address" envconfig:"ARBITRUM_NFT_ADDRESS"`
	NodeAddress     string `yaml:"arbitrum_node_address" envconfig:"ARBITRUM_NODE_ADDRESS"`
	MintNFTAmount   string `json:"arbitrum_mint_nft_amount" envconfig:"ARBITRUM_MINT_NFT_AMOUNT"`
	MintNFTDeposit  string `json:"arbitrum_mint_nft_deposit_address" envconfig:"ARBITRUM_MINT_NFT_DEPOSIT_ADDRESS"`
	FaucetAddress   string `yaml:"arbitrum_faucet_address" envconfig:"ARBITRUM_FAUCET_ADDRESS"`
	RPCURL          string `yaml:"arbitrum_rpc_url" envconfig:"ARBITRUM_RPC_URL"`
	WSURL           string `yaml:"arbitrum_ws_url" envconfig:"ARBITRUM_WS_URL"`
}

func (*Arbitrum) Init added in v0.4.0

func (a *Arbitrum) Init()

type Arbitrum3 added in v0.5.6

type Arbitrum3 struct {
	RPCURL string `yaml:"arbitrum_rpc_url" envconfig:"ARBITRUM_RPC_URL"`
}

func (*Arbitrum3) Init added in v0.5.6

func (a *Arbitrum3) Init()

type Common

type Common struct {
	AgoraAppCertificate string `yaml:"agora_app_certificate" envconfig:"AGORA_APP_CERTIFICATE"`
	AllowCORS           bool   `yaml:"allow_cors" envconfig:"ALLOW_CORS"`
	HostingAllowAll     bool   `yaml:"hosting_allow_all" envconfig:"HOSTING_ALLOW_ALL"`

	// Enabled pprof http endpoints. If enabled, point your browser at /debug/pprof
	PProfAPI bool `yaml:"pprof_api" envconfig:"PPROF_API"`
}

func (*Common) Init

func (x *Common) Init()

type Config

type Config struct {
	Common     Common     `yaml:"common"`
	Settings   Local      `yaml:"settings"`
	Postgres   Postgres   `yaml:"postgres"`
	Influx     Influx     `yaml:"influx"`
	Media      Media      `yaml:"media"`
	UIClient   UIClient   `yaml:"ui_client"`
	Streamchat Streamchat `yaml:"streamchat"`
	Arbitrum   Arbitrum   `yaml:"arbitrum"`
	Arbitrum3  Arbitrum3  `yaml:"arbitrum3"`
	OpenAI     OpenAI     `yaml:"open_ai"`
}

Config : structure to hold configuration

func GetConfig

func GetConfig() (*Config, error)

GetConfig : get config file

func (*Config) Init

func (x *Config) Init()

type Influx

type Influx struct {
	URL    string `yaml:"url" envconfig:"INFLUXDB_URL"`
	ORG    string `yaml:"org" envconfig:"INFLUXDB_ORG"`
	BUCKET string `yaml:"bucket" envconfig:"INFLUXDB_BUCKET"`
	TOKEN  string `yaml:"token" envconfig:"INFLUXDB_TOKEN"`
}

func (*Influx) Init

func (x *Influx) Init()

type Local

type Local struct {
	Address          string `yaml:"bind_address" envconfig:"UBERCONTROLLER_BIND_ADDRESS"`
	Port             uint   `yaml:"bind_port" envconfig:"UBERCONTROLLER_BIND_PORT"`
	LogLevel         int    `yaml:"loglevel"  envconfig:"UBERCONTROLLER_LOGLEVEL"`
	ExtensionStorage string `yaml:"storage"  envconfig:"UBERCONTROLLER_STORAGE"`
	SeedDataFiles    string `yaml:"seed_data_files" envconfig:"UBERCONTROLLER_SEED_DATA_FILES"`
	FrontendServeDir string `yaml:"frontend_serve_dir" envconfig:"FRONTEND_SERVE_DIR"`
	// TODO: rename FrontendURL to avoid confusing this with 'the frontend'
	FrontendURL string `yaml:"frontend_url" json:"-" envconfig:"FRONTEND_URL"` // URL where this instance is reachable (e.g. when behind a proxy)
}

func (*Local) Init

func (x *Local) Init()

type Media added in v0.5.6

type Media struct {
	Fontpath   string `yaml:"fontpath" envconfig:"RENDER_FONT_PATH"`
	Imagepath  string `yaml:"image_path" envconfig:"RENDER_IMAGE_PATH"`
	Audiopath  string `yaml:"audio_path" envconfig:"RENDER_AUDIO_PATH"`
	Videopath  string `yaml:"video_path" envconfig:"RENDER_VIDEO_PATH"`
	Assetpath  string `yaml:"asset_path" envconfig:"RENDER_ASSET_PATH"`
	Pluginpath string `yaml:"plugin_path" envconfig:"RENDER_PLUGIN_PATH"`
	LogLevel   int8   `yaml:"loglevel"  envconfig:"RENDER_LOGLEVEL"`
}

func (*Media) Init added in v0.5.6

func (x *Media) Init()

type OpenAI added in v0.5.6

type OpenAI struct {
	URL string `yaml:"open_ai_url" envconfig:"OPEN_AI_URL"`
}

func (*OpenAI) Init added in v0.5.6

func (a *OpenAI) Init()

type Postgres

type Postgres struct {
	DATABASE string `yaml:"database" envconfig:"DB_DATABASE"`
	HOST     string `yaml:"host" envconfig:"PGDB_HOST"`
	PORT     uint   `yaml:"port" envconfig:"DB_PORT"`
	USERNAME string `yaml:"username" envconfig:"DB_USERNAME"`
	PASSWORD string `yaml:"password" envconfig:"DB_PASSWORD"`
	MAXCONNS uint   `yaml:"max_conns" envconfig:"DB_MAX_CONNS"`
}

func (*Postgres) GenConfig

func (x *Postgres) GenConfig(log *zap.Logger) (*pgxpool.Config, error)

func (*Postgres) Init

func (x *Postgres) Init()

func (*Postgres) MinVersion

func (x *Postgres) MinVersion() *Postgres

type Streamchat

type Streamchat struct {
	APIKey    string `yaml:"key" envconfig:"STREAMCHAT_KEY"`
	APISecret string `yaml:"secret" envconfig:"STREAMCHAT_SECRET"`
}

func (*Streamchat) Init

func (s *Streamchat) Init()

type UIClient

type UIClient struct {
	AgoraAppID     string         `yaml:"agora_app_id" json:"AGORA_APP_ID" envconfig:"AGORA_APP_ID"`
	BlockchainID   string         `json:"BLOCKCHAIN_ID" envconfig:"ARBITRUM_CHAIN_ID"`
	ContractDAD    string         `json:"CONTRACT_DAD_ADDRESS" envconfig:"ARBITRUM_DAD_TOKEN_ADDRESS"`
	ContractFaucet string         `json:"CONTRACT_FAUCET_ADDRESS" envconfig:"ARBITRUM_FAUCET_ADDRESS"`
	ContractMOM    string         `json:"CONTRACT_MOM_ADDRESS" envconfig:"ARBITRUM_MOM_TOKEN_ADDRESS"`
	ContractNFT    string         `json:"CONTRACT_NFT_ADDRESS" envconfig:"ARBITRUM_NFT_ADDRESS"`
	ContractStake  string         `json:"CONTRACT_STAKING_ADDRESS" envconfig:"ARBITRUM_STAKE_ADDRESS"`
	MintNFTAmount  string         `json:"MINT_NFT_AMOUNT" envconfig:"ARBITRUM_MINT_NFT_AMOUNT"`
	MintNFTDeposit string         `json:"MINT_NFT_DEPOSIT_ADDRESS" envconfig:"ARBITRUM_MINT_NFT_DEPOSIT_ADDRESS"`
	FrontendURL    string         `yaml:"frontend_url" json:"-" envconfig:"FRONTEND_URL"`
	StreamchatKey  string         `yaml:"streamchat_key" json:"STREAMCHAT_KEY" envconfig:"STREAMCHAT_KEY"`
	FeatureFlags   UIFeatureFlags `yaml:"feature_flags" json:"FEATURE_FLAGS" envconfig:"FEATURE_FLAGS"`
}

func (*UIClient) Init

func (c *UIClient) Init(arb Arbitrum)

type UIFeatureFlags added in v0.4.0

type UIFeatureFlags struct {
	NewsFeed bool `json:"newsfeed" envconfig:"FEATURE_NEWSFEED"`
	BuyNft   bool `yaml:"buy_nft" json:"buy_nft" envconfig:"FEATURE_BUY_NFT"`
	Canvas   bool `json:"canvas" envconfig:"FEATURE_CANVAS"`
}

Jump to

Keyboard shortcuts

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