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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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