config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DEFAULT_CONFIG_FILE     = "../snmp.yaml"
	TaskSnmp                snmp.TaskSnmp
	DEFAULT_L2NEWCONFIG_FIL = "../internal/app/service/l2service/snmp.yaml"
)

Functions

func SnmpViper

func SnmpViper(path string)

Types

type DeployFolder

type DeployFolder struct {
	Dir string `mapstructure:"dir" json:"dir" yaml:"dir"`
}

type Desc

type Desc struct {
	Infor        Infor         `mapstructure:"infor" json:"infor" form:"infor"`
	PluginInfors []PluginInfor `mapstructure:"plugin_infor" json:"plugin_infor" form:"plugin_infor"`
}

type DeviceInfo

type DeviceInfo struct {
	Manufacture string   `yaml:"Manufacture"`
	Mode        string   `yaml:"Mode"`
	Type        string   `yaml:"Type"`
	Version     []string `yaml:"Version"`
}

type EachRole

type EachRole struct {
	Type string `json:"type" yaml:"type" mapstructure:"type"`
	Name string `json:"name" yaml:"name" mapstructure:"name"`
}

type Etcd

type Etcd struct {
	Addr string `mapstructure:"addr" json:"addr", yaml:"addr"`
}

type Excel

type Excel struct {
	Dir       string `mapstructure:"dir" json:"dir" yaml:"dir"`
	ExcelName string `mapstructure:"excel_name" json:"excel_name" yaml:"excel_name"`
}

type Infor

type Infor struct {
	Information Information `mapstructure:"information" json:"information" yaml:"information"`
}

type Information

type Information struct {
	TarName      string   `json:"tar_name" mapstructure:"tar-name" yaml:"tar-name"`
	MainFileName string   `json:"main_file_name" mapstructure:"main-file-name" yaml:"main-file-name"`
	Version      string   `mapstructure:"version" json:"version" yaml:"version"`
	SavePath     string   `mapstructure:"save-path" json:"save_path" yaml:"save-path"`
	DeployPath   string   `mapstructure:"deploy-path" json:"deploy_path" yaml:"deploy-path"`
	Md5          string   `mapstructure:"md5" json:"md5" yaml:"md5"`
	UpdateTime   string   `mapstructure:"update-time" json:"update_time" yaml:"update-time"`
	FileSize     int      `mapstructure:"file-size" json:"file_size" yaml:"file-size"`
	Plugins      []string `mapstructure:"plugins" json:"plugins" yaml:"plugins"`
	Plugin       string   `mapstructure:"plugin" json:"plugin" yaml:"plugin"`
}

type Mysql

type Mysql struct {
	Path         string `mapstructure:"path" json:"path" yaml:"path"`
	Config       string `mapstructure:"config" json:"config" yaml:"config"`
	Dbname       string `mapstructure:"db-name" json:"dbname" yaml:"db-name"`
	Username     string `mapstructure:"username" json:"username" yaml:"username"`
	Password     string `mapstructure:"password" json:"password" yaml:"password"`
	MaxIdleConns int    `mapstructure:"max-idle-conns" json:"maxIdleConns" yaml:"max-idle-conns"`
	MaxOpenConns int    `mapstructure:"max-open-conns" json:"maxOpenConns" yaml:"max-open-conns"`
	LogMode      bool   `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"`
	LogZap       string `mapstructure:"log-zap" json:"logZap" yaml:"log-zap"`
}

func (*Mysql) Dsn

func (m *Mysql) Dsn() string

type PlatForm

type PlatForm struct {
	Device map[string][]DeviceInfo `yaml:"device"`
}

type PluginFolder

type PluginFolder struct {
	Dir string `mapstructure:"dir" json:"dir" yaml:"dir"`
}

type PluginInfor

type PluginInfor struct {
	PInformation Information `mapstructure:"information" json:"information" yaml:"information"`
}

type Redis

type Redis struct {
	Host     string `mapstructure:"host" json:"host" yaml:"host"`
	DB       int    `mapstructure:"db" json:"db" yaml:"db"`
	Password string `mapstructure:"pass_word" json:"pass_word" yaml:"pass_word"`
}

type RoleConfig

type RoleConfig struct {
	InbandSecret   EachRole `json:"inbandSecret" yaml:"inbandSecret" mapstructure:"inbandSecret"`
	OutbandSecret  EachRole `json:"outbandSecret" yaml:"outbandSecret" mapstructure:"outbandSecret"`
	OutbandRedfish EachRole `json:"outbandRedfish" yaml:"outbandRedfish" mapstructure:"outbandRedfish"`
	InbandSnmp     EachRole `json:"inbandSnmp" yaml:"inbandSnmp" mapstructure:"inbandSnmp"`
	OutbandSnmp    EachRole `json:"outbandSnmp" yaml:"outbandSnmp" mapstructure:"outbandSnmp"`
	VmwareSecret   EachRole `json:"vmwareSecret" yaml:"vmwareSecret" mapstructure:"vmwareSecret"`
}

type SecretKey

type SecretKey struct {
	MasterKey string `mapstructure:"master_key" json:"master_key" yaml:"master_key"`
}

type Server

type Server struct {
	Mysql        Mysql        `mapstructure:"mysql" json:"mysql" yaml:"mysql"`
	Etcd         Etcd         `mapstructure:"etcd" json:"etcd" yaml:"etcd"`
	Redis        Redis        `mapstructure:"redis" json:"redis" yaml:"reids"`
	DeployFolder DeployFolder `mapstructure:"deploy_folder" json:"deploy_folder" yaml:"deploy_folder"`
	PluginFolder PluginFolder `mapstructure:"plugin_folder" json:"plugin_folder" yaml:"plugin_folder"`
	SecretKey    SecretKey    `mapstructure:"secret_key" json:"secret_key" yaml:"secret_key"`
	RoleConfig   RoleConfig   `mapstructure:"role_config" json:"role_config" yaml:"role_config"`
}

import ( "fmt"

"github.com/netxops/utils/snmp"

"github.com/fsnotify/fsnotify"

"github.com/spf13/viper" )

Jump to

Keyboard shortcuts

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