network

package
v0.0.0-...-0ff6af8 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FactoryConfig

func FactoryConfig() error

FactoryConfig 恢复出厂设置

func SaveConfig

func SaveConfig(newCfg *Config) error

SaveConfig 保存配置

Types

type Config

type Config struct {
	Auto         bool   `json:"auto"`                                             // 为true忽略其它参数,采用动态ip
	IPAddress    string `json:"ipAddress" validate:"ipv4"`                        // 静态Ip地址
	NetMask      string `json:"netMask" validate:"ipv4"`                          // 掩码
	Gateway      string `json:"gateway" validate:"ipv4"`                          // 网关地址
	PrimaryDNS   string `json:"primaryDNS,omitempty" validate:"ipv4|isdefault"`   // 主DNS服务器
	SecondaryDNS string `json:"secondaryDNS,omitempty" validate:"ipv4|isdefault"` // 次DNS服务器
	Mac          string `json:"-"`                                                // 这个是不准改的
}

Config 配置文件网络配置参数

func GetConfig

func GetConfig() Config

GetConfig 获得配置文件的相关配置

Jump to

Keyboard shortcuts

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