settings

package
v1.4.36 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bases

type Bases struct {
	Name     string `json:"Name"`
	UserName string `json:"UserName"`
	UserPass string `json:"UserPass"`
}

type Settings

type Settings struct {
	LogDir       string `yaml:"LogDir"`
	SettingsPath string

	Explorers []*struct {
		Property map[string]interface{} `yaml:"Property"`
		Name     string                 `yaml:"Name"`
	} `yaml:"Explorers"`
	DBCredentials *struct {
		URL           string `yaml:"URL" json:"URL,omitempty"`
		User          string `yaml:"User" json:"user,omitempty"`
		Password      string `yaml:"Password" json:"password,omitempty"`
		TLSSkipVerify bool   `yaml:"TLSSkipVerify" json:"TLSSkipVerify,omitempty"`
	} `yaml:"DBCredentials"`
	RAC *struct {
		Path  string `yaml:"Path"`
		Port  string `yaml:"Port"`
		Host  string `yaml:"Host"`
		Login string `yaml:"Login"`
		Pass  string `yaml:"Pass"`
	} `yaml:"RAC"`

	LogLevel int `yaml:"LogLevel" default:"4"` // Уровень логирования от 2 до 6, где 2 - ошибка, 3 - предупреждение, 4 - информация, 5 - дебаг, 6 - трейс
	// contains filtered or unexported fields
}

func LoadSettings

func LoadSettings(filePath string) (*Settings, error)

func (*Settings) GetDBCredentials

func (s *Settings) GetDBCredentials(ctx context.Context, cForce chan struct{})

func (*Settings) GetExplorers

func (s *Settings) GetExplorers() map[string]map[string]interface{}

func (*Settings) GetLogPass

func (s *Settings) GetLogPass(ibname string) (login, pass string)

func (*Settings) GetProperty

func (s *Settings) GetProperty(explorerName string, propertyName string, defaultValue interface{}) interface{}

func (*Settings) RAC_Host

func (s *Settings) RAC_Host() string

func (*Settings) RAC_Login

func (s *Settings) RAC_Login() string

func (*Settings) RAC_Pass

func (s *Settings) RAC_Pass() string

func (*Settings) RAC_Path

func (s *Settings) RAC_Path() string

func (*Settings) RAC_Port

func (s *Settings) RAC_Port() string

Jump to

Keyboard shortcuts

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