Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiConfig ¶
type ApiConfig struct { Port uint16 `envconfig:"API_PORT" default:"50051" required:"true"` Writer struct { Backoff time.Duration `envconfig:"API_WRITER_BACKOFF" default:"10s" required:"true"` BatchSize uint32 `envconfig:"API_WRITER_BATCH_SIZE" default:"16" required:"true"` Cache WriterCacheConfig Uri string `envconfig:"API_WRITER_URI" default:"resolver:50051" required:"true"` } UserAgent string `envconfig:"API_USER_AGENT" default:"Awakari" required:"true"` GroupId string `envconfig:"API_GROUP_ID" default:"default" required:"true"` Events EventsConfig }
type Config ¶
type Config struct { Api ApiConfig Db DbConfig Event SseConfig Log struct { Level int `envconfig:"LOG_LEVEL" default:"-4" required:"true"` } Replica ReplicaConfig }
func NewConfigFromEnv ¶
type DbConfig ¶
type DbConfig struct { Uri string `envconfig:"DB_URI" default:"mongodb://localhost:27017/?retryWrites=true&w=majority" required:"true"` Name string `envconfig:"DB_NAME" default:"sources" required:"true"` UserName string `envconfig:"DB_USERNAME" default:""` Password string `envconfig:"DB_PASSWORD" default:""` Table struct { Name string `envconfig:"DB_TABLE_NAME" default:"sse" required:"true"` Retention time.Duration `envconfig:"DB_TABLE_RETENTION" default:"2160h" required:"true"` Shard bool `envconfig:"DB_TABLE_SHARD" default:"true"` } Tls struct { Enabled bool `envconfig:"DB_TLS_ENABLED" default:"false" required:"true"` Insecure bool `envconfig:"DB_TLS_INSECURE" default:"false" required:"true"` } }
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:"100" required:"true"` } IdleTimeout time.Duration `envconfig:"API_EVENTS_CONN_IDLE_TIMEOUT" default:"15m" required:"true"` } Source string `envconfig:"API_EVENTS_SOURCE" default:"https://awakari.com/pub.html?srcType=sse" required:"true"` Limit uint32 `envconfig:"API_EVENTS_LIMIT" default:"1000" required:"true"` Topics TopicsConfig }
type ReplicaConfig ¶
type TopicsConfig ¶
type TopicsConfig struct {
Mastodon string `envconfig:"API_EVENTS_TOPIC_MASTODON" default:"source-sse-mastodon" required:"true"`
}
type WriterCacheConfig ¶
Click to show internal directories.
Click to hide internal directories.