Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Gateway Gateway `yaml:"gateway"` // gateway config
HTTP HTTP `yaml:"http"` // http server config
Database Database `yaml:"database"` // database config
FCM FCMConfig `yaml:"fcm"` // firebase cloud messaging config
Tasks Tasks `yaml:"tasks"` // tasks config
SSE SSE `yaml:"sse"` // server-sent events config
Messages Messages `yaml:"messages"` // messages config
Cache Cache `yaml:"cache"` // cache (memory or redis) config
PubSub PubSub `yaml:"pubsub"` // pubsub (memory or redis) config
}
type Database ¶
type Database struct {
Host string `yaml:"host" envconfig:"DATABASE__HOST"` // database host
Port int `yaml:"port" envconfig:"DATABASE__PORT"` // database port
User string `yaml:"user" envconfig:"DATABASE__USER"` // database user
Password string `yaml:"password" envconfig:"DATABASE__PASSWORD"` // database password
Database string `yaml:"database" envconfig:"DATABASE__DATABASE"` // database name
Timezone string `yaml:"timezone" envconfig:"DATABASE__TIMEZONE"` // database timezone
Debug bool `yaml:"debug" envconfig:"DATABASE__DEBUG"` // debug mode
MaxOpenConns int `yaml:"max_open_conns" envconfig:"DATABASE__MAX_OPEN_CONNS"` // max open connections
MaxIdleConns int `yaml:"max_idle_conns" envconfig:"DATABASE__MAX_IDLE_CONNS"` // max idle connections
}
type FCMConfig ¶
type FCMConfig struct {
CredentialsJSON string `yaml:"credentials_json" envconfig:"FCM__CREDENTIALS_JSON"` // firebase credentials json (public mode only)
DebounceSeconds uint16 `yaml:"debounce_seconds" envconfig:"FCM__DEBOUNCE_SECONDS"` // push notification debounce (>= 5s)
TimeoutSeconds uint16 `yaml:"timeout_seconds" envconfig:"FCM__TIMEOUT_SECONDS"` // push notification send timeout
}
type Gateway ¶
type Gateway struct {
Mode GatewayMode `yaml:"mode" envconfig:"GATEWAY__MODE"` // gateway mode: public or private
PrivateToken string `yaml:"private_token" envconfig:"GATEWAY__PRIVATE_TOKEN"` // device registration token in private mode
}
type GatewayMode ¶
type GatewayMode string
const ( GatewayModePublic GatewayMode = "public" GatewayModePrivate GatewayMode = "private" )
type HashingTask ¶
type HashingTask struct {
IntervalSeconds uint16 `yaml:"interval_seconds" envconfig:"TASKS__HASHING__INTERVAL_SECONDS"` // deprecated
}
type OpenAPI ¶ added in v1.29.0
type OpenAPI struct {
Enabled bool `yaml:"enabled" envconfig:"HTTP__OPENAPI__ENABLED"` // openapi enabled
}
type SSE ¶ added in v1.26.0
type SSE struct {
KeepAlivePeriodSeconds uint16 `yaml:"keep_alive_period_seconds" envconfig:"SSE__KEEP_ALIVE_PERIOD_SECONDS"` // keep alive period in seconds, 0 for no keep alive
}
type Tasks ¶
type Tasks struct {
Hashing HashingTask `yaml:"hashing"` // deprecated
}
Click to show internal directories.
Click to hide internal directories.