Documentation ¶
Index ¶
- Constants
- func AddOrDeleteIp(connectionID string, ip, mask string, operation string) ([]string, error)
- func GetStdoutText(r io.Reader) (stdout []string)
- func ImportOvpnConnection(filepath string) ([]string, error)
- func ModifyConnection(connectionID string, settings OvpnConnectionDefaults) ([]string, error)
- func ModifyIp(connectionID string, settings IpDefaults) ([]string, error)
- func SaveFile(filepath string, file []byte, permissions int) error
- func StringIpToInt(ipstring string) int
- func UnusedRoute(connectionID string, ret string) ([]string, error)
- func UpDownConnect(connectionID string, updown string) ([]string, error)
- type Auth
- type IpDefaults
- type NetworkConnection
- type NetworkConnections
- type OvpnConnectionDefaults
Constants ¶
const ( UP = "up" DOWN = "down" ADD = "+" DELETE = "-" YES = "yes" No = "no" )
Variables ¶
This section is empty.
Functions ¶
func AddOrDeleteIp ¶
添加或者删除ip地址
func GetStdoutText ¶
GetStdoutText reads out and concats string from io.Reader
func ImportOvpnConnection ¶
ImportOvpnConnection imports connection from openvpn file
func ModifyConnection ¶
func ModifyConnection(connectionID string, settings OvpnConnectionDefaults) ([]string, error)
ModifyConnection modifies the specified connection using settings provided
func ModifyIp ¶
func ModifyIp(connectionID string, settings IpDefaults) ([]string, error)
ModifyConnection modifies the connectionID Ip
func StringIpToInt ¶
func UnusedRoute ¶
是否忽略网关 nmcli connection modify Wired\ connection\ 2 ipv4.never-default yes
Types ¶
type IpDefaults ¶
IpDefaults settings to apply to an existing NetworkManager connection
type NetworkConnection ¶
NetworkConnection connection information provided by nmcli
type NetworkConnections ¶
type NetworkConnections []NetworkConnection
NetworkConnections array of NetworkConnection
func ListConnections ¶
func ListConnections(onlyActive bool) (out NetworkConnections, err error)
ListConnections shows connections via nmcli command
func (*NetworkConnections) FilterByType ¶
func (ncs *NetworkConnections) FilterByType(typeName string)
FilterByType excludes given type string
type OvpnConnectionDefaults ¶
OvpnConnectionDefaults settings to apply to an existing NetworkManager connection