config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDatabaseDSN

func GetDatabaseDSN(host string) string

func Init

func Init(configPath string)

func InitCliConfig

func InitCliConfig()

Types

type ArweaveConfig

type ArweaveConfig struct {
	Jwk       string `json:"jwk"`
	ClientUrl string `json:"client_url"`
}

type CliConfig

type CliConfig struct {
	ServerURL  string `json:"server_url"`
	UploadPath string `json:"upload_url"`
	QueryPath  string `json:"query_url"`
}

type Config

type Config struct {
	DB       DBConfig       `json:"db"`
	Platform PlatformConfig `json:"platform"`
	Arweave  ArweaveConfig  `json:"arweave"`
	Sqs      SqsConfig      `json:"sqs"`
}
var (
	C     *Config = new(Config)
	Viper *viper.Viper
)

type DBConfig

type DBConfig struct {
	Host          string   `json:"host"`
	ReadOnlyHosts []string `json:"read_only_hosts"`
	Port          uint     `json:"port"`
	User          string   `json:"user"`
	Password      string   `json:"password"`
	DBName        string   `json:"db_name"`
	TZ            string   `json:"tz"`
}

type DiscordPlatformConfig

type DiscordPlatformConfig struct {
	BotToken             string `json:"bot_token"`
	ProofServerChannelID string `json:"proof_server_channel_id"`
}

type EthereumPlatformConfig

type EthereumPlatformConfig struct {
	RPCServer string `json:"rpc_server"`
}

type PlatformConfig

type PlatformConfig struct {
	Twitter  TwitterPlatformConfig  `json:"twitter"`
	Telegram TelegramPlatformConfig `json:"telegram"`
	Ethereum EthereumPlatformConfig `json:"ethereum"`
	Discord  DiscordPlatformConfig  `json:"discord"`
}

type SqsConfig

type SqsConfig struct {
	QueueName string `json:"queue_name"`
}

type TelegramPlatformConfig

type TelegramPlatformConfig struct {
	ApiID             int    `json:"api_id"`
	ApiHash           string `json:"api_hash"`
	BotToken          string `json:"bot_token"`
	PublicChannelName string `json:"public_channel_name"`
}

type TwitterPlatformConfig

type TwitterPlatformConfig struct {
	AccessToken       string `json:"access_token"`
	AccessTokenSecret string `json:"access_token_secret"`
	ConsumerKey       string `json:"consumer_key"`
	ConsumerSecret    string `json:"consumer_secret"`
}

Jump to

Keyboard shortcuts

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