fin-thread

import "github.com/samgozman/fin-thread"

Index

Types

type App

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

type Config

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

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig creates a new Config object with default values.

func NewConfig

func NewConfig(env *Env) (*Config, error)

NewConfig creates a new Config object with the given Env and default values from DefaultConfig.

type Env

type Env struct {
	TelegramChannelID string `mapstructure:"TELEGRAM_CHANNEL_ID" validate:"required"`
	TelegramBotToken  string `mapstructure:"TELEGRAM_BOT_TOKEN" validate:"required"`
	OpenAiToken       string `mapstructure:"OPENAI_TOKEN" validate:"required"`
	TogetherAIToken   string `mapstructure:"TOGETHER_AI_TOKEN" validate:"required"`
	GoogleGeminiToken string `mapstructure:"GOOGLE_GEMINI_TOKEN"`
	PostgresDSN       string `mapstructure:"POSTGRES_DSN" validate:"required"`
	SentryDSN         string `mapstructure:"SENTRY_DSN" validate:"required"`
	StockSymbols      string `mapstructure:"STOCK_SYMBOLS" validate:"required"`
	MarketJournalists string `mapstructure:"MARKET_JOURNALISTS" validate:"required,json"`
	BroadJournalists  string `mapstructure:"BROAD_JOURNALISTS" validate:"required,json"`
	ServerName        string `mapstructure:"SERVER_NAME"`
	ShouldPublish     bool   `mapstructure:"SHOULD_PUBLISH" validate:"boolean"`
}

Env is a structure that holds all the environment variables that are used in the app.

Directories

archivist
composer
jobs
journalist
pkg/errlvl
publisher
scavenger