config

package
v0.0.0-...-1354829 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityPubConfig

type ActivityPubConfig struct {
	Uri string `envconfig:"API_SOURCE_ACTIVITYPUB_URI" default:"int-activitypub:50051" required:"true"`
}

type AuthConfig

type AuthConfig struct {
	Uri string `envconfig:"API_AUTH_URI" default:"auth:50051" required:"true"`
}

type Config

type Config struct {
	Api struct {
		Source struct {
			ActivityPub ActivityPubConfig
			Feeds       FeedsConfig
			Sites       SitesConfig
			Telegram    TelegramConfig
		}
		Writer WriterConfig
		Events EventsConfig
		TgBot  TgBotConfig
		Http   struct {
			Port uint16 `envconfig:"API_HTTP_PORT" default:"8080"`
		}
		Auth  AuthConfig
		Usage UsageConfig
	}
	Log struct {
		Level int `envconfig:"LOG_LEVEL" default:"-4" required:"true"`
	}
}

func NewConfigFromEnv

func NewConfigFromEnv() (cfg Config, err error)

type EventsConfig

type EventsConfig struct {
	Uri        string `envconfig:"API_EVENTS_URI" default:"events:50051" required:"true"`
	Connection struct {
		Count struct {
			Init uint32 `envconfig:"API_EVENTS_CONN_COUNT_INIT" default:"1" required:"true"`
			Max  uint32 `envconfig:"API_EVENTS_CONN_COUNT_MAX" default:"10" required:"true"`
		}
		IdleTimeout time.Duration `envconfig:"API_EVENTS_CONN_IDLE_TIMEOUT" default:"15m" required:"true"`
	}
	Topic string `envconfig:"API_EVENTS_TOPIC" default:"published" required:"true"`
	Limit uint32 `envconfig:"API_EVENTS_LIMIT" default:"100000" required:"true"`
}

type FeedsConfig

type FeedsConfig struct {
	Uri string `envconfig:"API_SOURCE_FEEDS_URI" default:"source-feeds:50051" required:"true"`
}

type SitesConfig

type SitesConfig struct {
	Uri string `envconfig:"API_SOURCE_SITES_URI" default:"source-sites:50051" required:"true"`
}

type TelegramConfig

type TelegramConfig struct {
	Uri           string `envconfig:"API_SOURCE_TELEGRAM_URI" default:"source-telegram:50051" required:"true"`
	FmtUriReplica string `envconfig:"API_SOURCE_TELEGRAM_FMT_URI_REPLICA" default:"source-telegram-%d:50051" required:"true"`
}

type TgBotConfig

type TgBotConfig struct {
	Uri string `envconfig:"API_TGBOT_URI" default:"bot-telegram:50051" required:"true"`
}

type UsageConfig

type UsageConfig struct {
	Uri        string `envconfig:"API_USAGE_URI" default:"usage:50051" required:"true"`
	Connection struct {
		Count struct {
			Init uint32 `envconfig:"API_USAGE_CONN_COUNT_INIT" default:"1" required:"true"`
			Max  uint32 `envconfig:"API_USAGE_CONN_COUNT_MAX" default:"10" required:"true"`
		}
		IdleTimeout time.Duration `envconfig:"API_USAGE_CONN_IDLE_TIMEOUT" default:"15m" required:"true"`
	}
}

type WriterConfig

type WriterConfig struct {
	Internal WriterInternalConfig
}

type WriterInternalConfig

type WriterInternalConfig struct {
	Name               string `envconfig:"API_WRITER_INTERNAL_NAME" default:"awkinternal" required:"true"`
	Value              int32  `envconfig:"API_WRITER_INTERNAL_VALUE" required:"true"`
	RateLimitPerMinute int    `envconfig:"API_WRITER_INTERNAL_RATE_LIMIT_PER_MINUTE" default:"1" required:"true"`
}

Jump to

Keyboard shortcuts

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