setting

package
v0.0.0-...-d5751c4 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppSetting

type AppSetting struct {
	WorkersCount  int    `json:"workers_count,omitempty" env:"GF_PLUGIN_WORKERS_COUNT"`
	DataDirectory string `json:"data_directory,omitempty" env:"GF_PLUGIN_DATA_DIRECTORY"`

	MailConfig     MailConfig
	GrafanaSetting GrafanaSetting
	DatabaseConfig DatabaseConfig
	BrowserConfig  BrowserConfig
}

func NewAppSetting

func NewAppSetting() (*AppSetting, error)

type BrowserConfig

type BrowserConfig struct {
	Type    string `json:"browser_type,omitempty" env:"GF_PLUGIN_BROWSER_TYPE"`
	BinPath string `json:"browser_bin_path,omitempty" env:"GF_PLUGIN_BROWSER_BIN_PATH"`
	URL     string `json:"browser_url,omitempty" env:"GF_PLUGIN_BROWSER_URL"`
}

type DatabaseConfig

type DatabaseConfig struct {
	Timeout         int    `json:"database_timeout,omitempty" env:"GF_PLUGIN_DATABASE_TIMEOUT"`
	MaxBatchSize    int    `json:"database_max_batch_size,omitempty" env:"GF_PLUGIN_DATABASE_MAX_BATCH_SIZE"`
	MaxBatchDelay   int    `json:"database_max_batch_delay,omitempty" env:"GF_PLUGIN_DATABASE_MAX_BATCH_DELAY"`
	InitialMmapSize int    `json:"database_initial_mmap_size,omitempty" env:"GF_PLUGIN_DATABASE_INITIAL_MMAP_SIZE"`
	EncryptionKey   []byte `json:"database_encryption_key,omitempty" env:"GF_PLUGIN_DATABASE_ENCRYPTION_KEY"`
}

type GrafanaSetting

type GrafanaSetting struct {
	URL                string        `json:"grafana_url,omitempty" env:"GF_PLUGIN_GRAFANA_URL"`
	InsecureSkipVerify bool          `json:"grafana_insecure_skip_verify,omitempty" env:"GF_PLUGIN_GRAFANA_INSECURE_SKIP_VERIFY"`
	RetryNum           int           `json:"grafana_retry_num,omitempty" env:"GF_PLUGIN_GRAFANA_RETRY_NUM"`
	RetryTimeout       time.Duration `json:"grafana_retry_timeout" env:"GF_PLUGIN_GRAFANA_RETRY_TIMEOUT"`
	RetryStatusCodes   string        `json:"grafana_retry_status_codes,omitempty" env:"GF_PLUGIN_GRAFANA_RETRY_STATUS_CODES"`

	APIToken string `json:"grafana_api_token,omitempty" env:"GF_PLUGIN_GRAFANA_API_TOKEN"`
	Username string `json:"grafana_username,omitempty" env:"GF_PLUGIN_GRAFANA_USERNAME"`
	Password string `json:"grafana_password,omitempty" env:"GF_PLUGIN_GRAFANA_PASSWORD"`
}

func (*GrafanaSetting) BasicAuth

func (a *GrafanaSetting) BasicAuth() string

func (*GrafanaSetting) RetryStatusCodesArr

func (a *GrafanaSetting) RetryStatusCodesArr() []string

type InstanceSetting

type InstanceSetting struct {
	OrgID    int
	Timezone string `json:"timezone"`
}

func NewInstanceSetting

func NewInstanceSetting(settings backend.AppInstanceSettings) *InstanceSetting

func (*InstanceSetting) Store

type InstancesSetting

type InstancesSetting struct {
	M map[int]*InstanceSetting
	// contains filtered or unexported fields
}

func InstanceSettingFromStore

func InstanceSettingFromStore(db store.DatabaseManager) (*InstancesSetting, error)

func (*InstancesSetting) Load

func (i *InstancesSetting) Load(key int) (*InstanceSetting, bool)

func (*InstancesSetting) Store

func (i *InstancesSetting) Store(key int, value *InstanceSetting)

type MailConfig

type MailConfig struct {
	Host     string `json:"mail_host" env:"GF_PLUGIN_MAIL_HOST"`
	Port     int    `json:"mail_port" env:"GF_PLUGIN_MAIL_PORT"`
	Username string `json:"mail_username" env:"GF_PLUGIN_MAIL_USERNAME"`
	Password string `json:"mail_password" env:"GF_PLUGIN_MAIL_PASSWORD"`
}

type Setting

type Setting struct {
	AppSetting       *AppSetting
	InstancesSetting *InstancesSetting
}

Jump to

Keyboard shortcuts

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