Documentation
¶
Overview ¶
Package config provides the App configuration.
Index ¶
Constants ¶
View Source
const ( // ConfigsPath declares the directory where configuration files are stored. ConfigsPath = "configs" // AppFilename declares name of the application configuration file. AppFilename = "joe.yml" // MetadataPath declares path where metadata files are stored. MetadataPath = "meta" // SessionsFilename declares name of the file that stores current Joe Bot sessions. SessionsFilename = "sessions.json" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
Version string
Host string `env:"JOE_APP_HOST"`
Port uint `env:"JOE_APP_PORT" env-default:"2400"`
MinNotifyDuration time.Duration `env:"JOE_APP_MIN_NOTIFY_DURATION" env-default:"60s"`
Debug bool `env:"JOE_APP_DEBUG"`
}
App defines a general application configuration.
type Channel ¶
type Channel struct {
ChannelID string `yaml:"channelID" json:"channel_id"`
DBLabID string `yaml:"dblabServer" json:"-"`
DBLabParams DBLabParams `yaml:"dblabParams" json:"-"`
}
Channel defines a connection channel configuration.
type ChannelMapping ¶
type ChannelMapping struct {
CommunicationTypes map[string][]Workspace `yaml:"communicationTypes,flow"`
DBLabInstances map[string]DBLabInstance `yaml:"dblabServers"`
}
ChannelMapping contains configuration parameters of communication types and Database Labs.
type Config ¶
type Config struct {
App App `yaml:"app"`
Platform Platform `yaml:"platform"`
Registration Registration `yaml:"registration"`
ChannelMapping *ChannelMapping `yaml:"channelMapping"`
Enterprise definition.EnterpriseOptions `yaml:"-"`
}
Config defines an App configuration.
type Credentials ¶
type Credentials struct {
AccessToken string `yaml:"accessToken"`
SigningSecret string `yaml:"signingSecret"`
AppLevelToken string `yaml:"appLevelToken"`
}
Credentials defines connection space credentials.
type DBLabInstance ¶
DBLabInstance contains Database Lab config.
type DBLabParams ¶
type DBLabParams struct {
DBName string `yaml:"dbname" json:"-"`
SSLMode string `yaml:"sslmode" json:"-"`
}
DBLabParams defines database params for clone creation.
type Platform ¶
type Platform struct {
URL string `yaml:"url" env:"JOE_PLATFORM_URL" env-default:"https://postgres.ai/api/general"`
Token string `yaml:"token" env:"JOE_PLATFORM_TOKEN"`
Project string `yaml:"project" env:"JOE_PLATFORM_PROJECT"`
HistoryEnabled bool `yaml:"historyEnabled" env:"JOE_PLATFORM_HISTORY_ENABLED"`
}
Platform describes configuration parameters of a Postgres.ai platform.
type Registration ¶
Registration describes configuration parameters to register an application on the Platform.
type Workspace ¶
type Workspace struct {
Name string
Credentials Credentials
Channels []Channel
}
Workspace defines a connection space.
Click to show internal directories.
Click to hide internal directories.