config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FlagConfig is name of CLI flags for config.
	FlagConfig = "config"

	// DefaultConfigFile is default file name of config.
	DefaultConfigFile = "default.yaml"

	// DefaultGRPCPort is default port number of grpc service.
	DefaultGRPCPort = 19090

	// DefaultHTTPPort is default port number of http service.
	DefaultHTTPPort = 19091

	// DefaultHomePath  default home directory of VATZ.
	DefaultHomePath = "~/.vatz"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudLoggingCredentialInfo added in v1.2.0

type CloudLoggingCredentialInfo struct {
	ProjectID       string   `yaml:"project_id"`
	CredentialsType string   `yaml:"credentials_type"`
	Credentials     string   `yaml:"credentials"`
	CheckerSchedule []string `yaml:"checker_schedule"`
}

type Config

type Config struct {
	Vatz        VatzProtocolInfo `yaml:"vatz_protocol_info"`
	PluginInfos PluginInfo       `yaml:"plugins_infos"`
}

Config is Vatz config structure.

func GetConfig

func GetConfig() *Config

GetConfig returns current Vatz config.

func InitConfig

func InitConfig(configFile string) (*Config, error)

InitConfig - initializes VATZ config.

type GCPCloudLoggingInfo added in v1.2.0

type GCPCloudLoggingInfo struct {
	Enabled           bool                       `yaml:"enabled"`
	GCPCredentialInfo CloudLoggingCredentialInfo `yaml:"cloud_logging_credential_info"`
}

type MonitoringInfo

type MonitoringInfo struct {
	GCP struct {
		GCPCloudLogging GCPCloudLoggingInfo `yaml:"gcp_cloud_logging_info"`
	} `yaml:"gcp"`
	Prometheus struct {
		Enabled bool   `yaml:"enabled"`
		Address string `yaml:"address"`
		Port    int    `yaml:"port"`
	} `yaml:"prometheus"`
}

MonitoringInfo is structure for RPC service configuration.

type NotificationInfo

type NotificationInfo struct {
	HostName                string   `yaml:"host_name"`
	DefaultReminderSchedule []string `yaml:"default_reminder_schedule"`
	DispatchChannels        []struct {
		Channel          string   `yaml:"channel"`
		Secret           string   `yaml:"secret"`
		ChatID           string   `yaml:"chat_id"`
		Subscriptions    []string `yaml:"subscriptions,omitempty"`
		ReminderSchedule []string `yaml:"reminder_schedule"`
	} `yaml:"dispatch_channels"`
}

NotificationInfo is notification structure.

type Plugin

type Plugin struct {
	Name              string `yaml:"plugin_name"`
	Address           string `yaml:"plugin_address"`
	VerifyInterval    int    `yaml:"verify_interval"`
	ExecuteInterval   int    `yaml:"execute_interval"`
	Port              int    `yaml:"plugin_port"`
	ExecutableMethods []struct {
		Name string `yaml:"method_name"`
	} `yaml:"executable_methods"`
}

Plugin contains specific plugin info.

type PluginInfo

type PluginInfo struct {
	DefaultVerifyInterval  int      `yaml:"default_verify_interval"`
	DefaultExecuteInterval int      `yaml:"default_execute_interval"`
	DefaultPluginName      string   `yaml:"default_plugin_name"`
	Plugins                []Plugin `yaml:"plugins"`
}

PluginInfo contains general plugin info.

type RPCInfo

type RPCInfo struct {
	Enabled  bool   `yaml:"enabled"`
	Address  string `yaml:"address"`
	GRPCPort int    `yaml:"grpc_port"`
	HTTPPort int    `yaml:"http_port"`
}

RPCInfo is structure for RPC service configuration.

type VatzProtocolInfo

type VatzProtocolInfo struct {
	ProtocolIdentifier    string           `yaml:"protocol_identifier"`
	Port                  int              `yaml:"port"`
	NotificationInfo      NotificationInfo `yaml:"notification_info"`
	HealthCheckerSchedule []string         `yaml:"health_checker_schedule"`
	RPCInfo               RPCInfo          `yaml:"rpc_info"`
	MonitoringInfo        MonitoringInfo   `yaml:"monitoring_info"`
	HomePath              string           `yaml:"home_path"`
}

VatzProtocolInfo is VATZ information.

func (VatzProtocolInfo) AbsoluteHomePath

func (i VatzProtocolInfo) AbsoluteHomePath() (string, error)

AbsoluteHomePath is the default home path

Jump to

Keyboard shortcuts

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