Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultPanelsPath = "schemas/panels" DefaultQueriesPath = "schemas/queries" DefaultDatasourcesPath = "schemas/datasources" DefaultVariablesPath = "schemas/variables" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Readonly will deactivate any HTTP POST, PUT, DELETE endpoint
Readonly bool `json:"readonly" yaml:"readonly"`
// EncryptionKey is the secret key used to encrypt and decrypt sensitive data stored in the database such as the password of the basic auth for a datasource
// Note that if it is not provided it will be generated. When perses is used in a multi instance mode, you should provide the key.
// Otherwise, each instance will have a different key and therefore won't be able to decrypt what the other is encrypting.
// Also note the key must be at least 32 bytes long.
EncryptionKey promConfig.Secret `json:"encryption_key,omitempty" yaml:"encryption_key,omitempty"`
// EncryptionKeyFile is the path to file containing the secret key
EncryptionKeyFile string `json:"encryption_key_file,omitempty" yaml:"encryption_key_file,omitempty"`
// Database contains the different configuration depending on the database you want to use
Database Database `json:"database" yaml:"database"`
// Schemas contains the configuration to get access to the CUE schemas
Schemas Schemas `json:"schemas" yaml:"schemas"`
// ImportantDashboards contains important dashboard selectors
ImportantDashboards []dashboardSelector `json:"important_dashboards,omitempty" yaml:"important_dashboards,omitempty"`
// Information contains markdown content to be display on the home page
Information string `json:"information,omitempty" yaml:"information,omitempty"`
}
type Database ¶
type File ¶
type File struct {
Folder string `json:"folder" yaml:"folder"`
Extension FileExtension `json:"extension" yaml:"extension"`
}
type FileExtension ¶
type FileExtension string
const ( YAMLExtension FileExtension = "yaml" JSONExtension FileExtension = "json" )
type SQL ¶ added in v0.24.0
type SQL struct {
// TLS configuration
TLSConfig *config.TLSConfig `json:"tls_config,omitempty" yaml:"tls_config,omitempty"`
// Username
User config.Secret `json:"user,omitempty" yaml:"user,omitempty"`
// Password (requires User)
Password config.Secret `json:"password,omitempty" yaml:"password,omitempty"`
// PasswordFile is a path to a file that contains a password
PasswordFile string `json:"password_file,omitempty" yaml:"password_file,omitempty"`
// Network type
Net string `json:"net,omitempty" yaml:"net,omitempty"`
// Network address (requires Net)
Addr config.Secret `json:"addr,omitempty" yaml:"addr,omitempty"`
// Database name
DBName string `json:"db_name" yaml:"db_name"`
// Connection collation
Collation string `json:"collation,omitempty" yaml:"collation,omitempty"`
// Location for time.Time values
Loc *time.Location `json:"loc,omitempty" yaml:"loc,omitempty"`
// Max packet size allowed
MaxAllowedPacket int `json:"max_allowed_packet" yaml:"maxAllowedPacket"`
// Server public key name
ServerPubKey string `json:"server_pub_key" yaml:"server_pub_key"`
// Dial timeout
Timeout time.Duration `json:"timeout" yaml:"timeout"`
// I/O read timeout
ReadTimeout time.Duration `json:"read_timeout" yaml:"read_timeout"`
// I/O write timeout
WriteTimeout time.Duration `json:"write_timeout" yaml:"write_timeout"`
// Allow all files to be used with LOAD DATA LOCAL INFILE
AllowAllFiles bool `json:"allow_all_files" yaml:"allow_all_files"`
// Allows the cleartext client side plugin
AllowCleartextPasswords bool `json:"allow_cleartext_passwords" yaml:"allow_cleartext_passwords"`
// Allows fallback to unencrypted connection if server does not support TLS
AllowFallbackToPlaintext bool `json:"allow_fallback_to_plaintext" yaml:"allow_fallback_to_plaintext"`
// Allows the native password authentication method
AllowNativePasswords bool `json:"allow_native_passwords" yaml:"allow_native_passwords"`
// Allows the old insecure password method
AllowOldPasswords bool `json:"allow_old_passwords" yaml:"allow_old_passwords"`
// Check connections for liveness before using them
CheckConnLiveness bool `json:"check_conn_liveness" yaml:"check_conn_liveness"`
// Return number of matching rows instead of rows changed
ClientFoundRows bool `json:"client_found_rows" yaml:"client_found_rows"`
// Prepend table alias to column names
ColumnsWithAlias bool `json:"columns_with_alias" yaml:"columns_with_alias"`
// Interpolate placeholders into query string
InterpolateParams bool `json:"interpolate_params" yaml:"interpolate_params"`
// Allow multiple statements in one query
MultiStatements bool `json:"multi_statements" yaml:"multi_statements"`
// Parse time values to time.Time
ParseTime bool `json:"parse_time" yaml:"parse_time"`
// Reject read-only connections
RejectReadOnly bool `json:"reject_read_only" yaml:"reject_read_only"`
}
type Schemas ¶
type Schemas struct {
PanelsPath string `yaml:"panels_path,omitempty"`
QueriesPath string `yaml:"queries_path,omitempty"`
DatasourcesPath string `yaml:"datasources_path,omitempty"`
VariablesPath string `yaml:"variables_path,omitempty"`
Interval time.Duration `yaml:"interval,omitempty"`
}
func (Schemas) MarshalJSON ¶ added in v0.13.0
Click to show internal directories.
Click to hide internal directories.