config

package
v0.0.0-...-6d1ceae Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Env string `envconfig:"ENV" default:"dokku"`

	HTTPHost string `envconfig:"HTTP_HOST" default:"0.0.0.0"`
	HTTPPort string `envconfig:"HTTP_PORT" default:"8080"`
	BaseURL  string `envconfig:"BASE_URL" default:"https://tinycooks.xyz"`

	Version string `envconfig:"GIT_REV" default:"v0.0.1"`

	Secret          string `envconfig:"SECRET" required:"true"`
	Expire          int    `envconfig:"EXPIRE" default:"2592000"` // seconds
	LiveSessionName string `envconfig:"LIVE_SESSION_NAME" default:"tc-go-live-session"`

	GoogleAnalyticsID string `envconfig:"GOOGLE_ANALYTICS_ID" default:""`
	CommentsID        string `envconfig:"COMMENTS_ID" default:""`

	StorageType   string `envconfig:"STORAGE_TYPE" default:"ent"`
	StorageDriver string `envconfig:"STORAGE_DRIVER" default:"postgres"`
	StorageDSN    string `envconfig:"STORAGE_DSN" required:"true"`
	UseCache      bool   `envconfig:"USE_CACHE" default:"true"`
	LogDBQueries  bool   `envconfig:"LOG_DB_QUERIES" default:"false"`

	PageSize int `envconfig:"PAGE_SIZE" default:"20"`

	AirtableAPIKey string `envconfig:"AIRTABLE_API_KEY" required:"true"`
	AirtableBaseID string `envconfig:"AIRTABLE_BASE_ID" required:"true"`
	AirtableTable  string `envconfig:"AIRTABLE_TABLE" required:"true"`

	CreateJobs              bool   `envconfig:"CREATE_JOBS" default:"true"`
	ModerationCheckSchedule string `envconfig:"MODERATION_CHECK_SCHEDULE" default:"*/10 * * * *"`
}

func LoadConfig

func LoadConfig() (*Config, error)

func (*Config) Dev

func (c *Config) Dev() bool

func (*Config) GetAddress

func (c *Config) GetAddress() string

Jump to

Keyboard shortcuts

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