config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DashboardConfig

type DashboardConfig struct {
	ClusterName string
	DeployDir   string
}

DashboardConfig represent the data to generate Dashboard config

func NewDashboardConfig

func NewDashboardConfig(cluster, deployDir string) *DashboardConfig

NewDashboardConfig returns a DashboardConfig

func (*DashboardConfig) Config

func (c *DashboardConfig) Config() ([]byte, error)

Config generate the config file data.

func (*DashboardConfig) ConfigToFile

func (c *DashboardConfig) ConfigToFile(file string) error

ConfigToFile write config content to specific path

func (*DashboardConfig) ConfigWithTemplate

func (c *DashboardConfig) ConfigWithTemplate(tpl string) ([]byte, error)

ConfigWithTemplate generate the Dashboard config content by tpl

func (*DashboardConfig) DashboardToFile

func (c *DashboardConfig) DashboardToFile(file string, tplFile string) error

DashboardToFile writes config content to specific path

func (*DashboardConfig) ReadDashboardsDir

func (c *DashboardConfig) ReadDashboardsDir() ([]fs.DirEntry, error)

ReadDashboardsDir reads config content to specific path

type DatasourceConfig

type DatasourceConfig struct {
	ClusterName string
	URL         string
}

DatasourceConfig represent the data to generate Datasource config

func (*DatasourceConfig) ConfigToFile

func (c *DatasourceConfig) ConfigToFile(file string) error

ConfigToFile write config content to specific path

type GrafanaConfig

type GrafanaConfig struct {
	DeployDir       string
	IP              string
	Port            uint64
	Username        string // admin_user
	Password        string // admin_password
	AnonymousEnable bool   // anonymous enable
	RootURL         string // root_url
	Domain          string // domain
	DefaultTheme    string // default_theme
	OrgName         string // org_name
	OrgRole         string // org_role
}

GrafanaConfig represent the data to generate Grafana config

func NewGrafanaConfig

func NewGrafanaConfig(ip, deployDir string) *GrafanaConfig

NewGrafanaConfig returns a GrafanaConfig

func (*GrafanaConfig) Config

func (c *GrafanaConfig) Config() ([]byte, error)

Config generate the config file data.

func (*GrafanaConfig) ConfigToFile

func (c *GrafanaConfig) ConfigToFile(file string) error

ConfigToFile write config content to specific path

func (*GrafanaConfig) ConfigWithTemplate

func (c *GrafanaConfig) ConfigWithTemplate(tpl string) ([]byte, error)

ConfigWithTemplate generate the Grafana config content by tpl

func (*GrafanaConfig) WithAnonymousenable

func (c *GrafanaConfig) WithAnonymousenable(anonymousEnable bool) *GrafanaConfig

WithAnonymousenable sets anonymousEnable of anonymousEnable

func (*GrafanaConfig) WithDefaultTheme

func (c *GrafanaConfig) WithDefaultTheme(defaultTheme string) *GrafanaConfig

WithDefaultTheme sets defaultTheme of default theme

func (*GrafanaConfig) WithDomain

func (c *GrafanaConfig) WithDomain(domain string) *GrafanaConfig

WithDomain sets domain of server domain

func (*GrafanaConfig) WithOrgName

func (c *GrafanaConfig) WithOrgName(orgName string) *GrafanaConfig

WithOrgName sets orgName of org name

func (*GrafanaConfig) WithOrgRole

func (c *GrafanaConfig) WithOrgRole(orgRole string) *GrafanaConfig

WithOrgRole sets orgName of org role

func (*GrafanaConfig) WithPassword

func (c *GrafanaConfig) WithPassword(passwd string) *GrafanaConfig

WithPassword sets password of admin user

func (*GrafanaConfig) WithPort

func (c *GrafanaConfig) WithPort(port uint64) *GrafanaConfig

WithPort set Port field of GrafanaConfig

func (*GrafanaConfig) WithRootURL

func (c *GrafanaConfig) WithRootURL(rootURL string) *GrafanaConfig

WithRootURL sets rootURL of root url

func (*GrafanaConfig) WithUsername

func (c *GrafanaConfig) WithUsername(user string) *GrafanaConfig

WithUsername sets username of admin user

type TsMonitorConfig

type TsMonitorConfig struct {
	Host         string
	MetricPath   string
	ErrorLogPath string
	DataPath     string
	WALPath      string
	ProcessName  string
	MonitorAddr  string
	MonitorDB    string
	TLSEnabled   bool
	LoggingPath  string
}

TsMonitorConfig represent the data to generate ts-monitor config

func (*TsMonitorConfig) Config

func (c *TsMonitorConfig) Config() ([]byte, error)

Config generate the config file data.

func (*TsMonitorConfig) ConfigToFile

func (c *TsMonitorConfig) ConfigToFile(file string) error

ConfigToFile write config content to specific path

func (*TsMonitorConfig) ConfigWithTemplate

func (c *TsMonitorConfig) ConfigWithTemplate(tpl string) ([]byte, error)

ConfigWithTemplate generate the AlertManager config content by tpl

Jump to

Keyboard shortcuts

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