MM-14617 Dependency upgrades and adding modules support. (#10517)
* Dependency upgrades and adding modules support. * Commenting out file tests playload verification portion. * Fixing viper. * Fixing hclog.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
bd8a54bb08
Коммит
41d117c37b
2
vendor/github.com/hashicorp/go-sockaddr/GNUmakefile
сгенерированный
поставляемый
2
vendor/github.com/hashicorp/go-sockaddr/GNUmakefile
сгенерированный
поставляемый
@@ -55,7 +55,7 @@ doc::
|
||||
|
||||
world::
|
||||
@set -e; \
|
||||
for os in solaris darwin freebsd linux windows; do \
|
||||
for os in solaris darwin freebsd linux windows android; do \
|
||||
for arch in amd64; do \
|
||||
printf "Building on %s-%s\n" "$${os}" "$${arch}" ; \
|
||||
env GOOS="$${os}" GOARCH="$${arch}" go build -o /dev/null; \
|
||||
|
||||
47
vendor/github.com/hashicorp/go-sockaddr/ifaddrs.go
сгенерированный
поставляемый
47
vendor/github.com/hashicorp/go-sockaddr/ifaddrs.go
сгенерированный
поставляемый
@@ -1197,18 +1197,12 @@ func parseDefaultIfNameFromRoute(routeOut string) (string, error) {
|
||||
// parseDefaultIfNameFromIPCmd parses the default interface from ip(8) for
|
||||
// Linux.
|
||||
func parseDefaultIfNameFromIPCmd(routeOut string) (string, error) {
|
||||
lines := strings.Split(routeOut, "\n")
|
||||
re := whitespaceRE.Copy()
|
||||
for _, line := range lines {
|
||||
kvs := re.Split(line, -1)
|
||||
if len(kvs) < 5 {
|
||||
continue
|
||||
}
|
||||
|
||||
if kvs[0] == "default" &&
|
||||
kvs[1] == "via" &&
|
||||
kvs[3] == "dev" {
|
||||
ifName := strings.TrimSpace(kvs[4])
|
||||
parsedLines := parseIfNameFromIPCmd(routeOut)
|
||||
for _, parsedLine := range parsedLines {
|
||||
if parsedLine[0] == "default" &&
|
||||
parsedLine[1] == "via" &&
|
||||
parsedLine[3] == "dev" {
|
||||
ifName := strings.TrimSpace(parsedLine[4])
|
||||
return ifName, nil
|
||||
}
|
||||
}
|
||||
@@ -1216,6 +1210,35 @@ func parseDefaultIfNameFromIPCmd(routeOut string) (string, error) {
|
||||
return "", errors.New("No default interface found")
|
||||
}
|
||||
|
||||
// parseDefaultIfNameFromIPCmdAndroid parses the default interface from ip(8) for
|
||||
// Android.
|
||||
func parseDefaultIfNameFromIPCmdAndroid(routeOut string) (string, error) {
|
||||
parsedLines := parseIfNameFromIPCmd(routeOut)
|
||||
if (len(parsedLines) > 0) {
|
||||
ifName := strings.TrimSpace(parsedLines[0][4])
|
||||
return ifName, nil
|
||||
}
|
||||
|
||||
return "", errors.New("No default interface found")
|
||||
}
|
||||
|
||||
|
||||
// parseIfNameFromIPCmd parses interfaces from ip(8) for
|
||||
// Linux.
|
||||
func parseIfNameFromIPCmd(routeOut string) [][]string {
|
||||
lines := strings.Split(routeOut, "\n")
|
||||
re := whitespaceRE.Copy()
|
||||
parsedLines := make([][]string, 0, len(lines))
|
||||
for _, line := range lines {
|
||||
kvs := re.Split(line, -1)
|
||||
if len(kvs) < 5 {
|
||||
continue
|
||||
}
|
||||
parsedLines = append(parsedLines, kvs)
|
||||
}
|
||||
return parsedLines
|
||||
}
|
||||
|
||||
// parseDefaultIfNameWindows parses the default interface from `netstat -rn` and
|
||||
// `ipconfig` on Windows.
|
||||
func parseDefaultIfNameWindows(routeOut, ipconfigOut string) (string, error) {
|
||||
|
||||
34
vendor/github.com/hashicorp/go-sockaddr/route_info_android.go
сгенерированный
поставляемый
Обычный файл
34
vendor/github.com/hashicorp/go-sockaddr/route_info_android.go
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,34 @@
|
||||
package sockaddr
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
type routeInfo struct {
|
||||
cmds map[string][]string
|
||||
}
|
||||
|
||||
// NewRouteInfo returns a Android-specific implementation of the RouteInfo
|
||||
// interface.
|
||||
func NewRouteInfo() (routeInfo, error) {
|
||||
return routeInfo{
|
||||
cmds: map[string][]string{"ip": {"/system/bin/ip", "route", "get", "8.8.8.8"}},
|
||||
}, nil
|
||||
}
|
||||
|
||||
// GetDefaultInterfaceName returns the interface name attached to the default
|
||||
// route on the default interface.
|
||||
func (ri routeInfo) GetDefaultInterfaceName() (string, error) {
|
||||
out, err := exec.Command(ri.cmds["ip"][0], ri.cmds["ip"][1:]...).Output()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
|
||||
var ifName string
|
||||
if ifName, err = parseDefaultIfNameFromIPCmdAndroid(string(out)); err != nil {
|
||||
return "", errors.New("No default interface found")
|
||||
}
|
||||
return ifName, nil
|
||||
}
|
||||
2
vendor/github.com/hashicorp/go-sockaddr/route_info_linux.go
сгенерированный
поставляемый
2
vendor/github.com/hashicorp/go-sockaddr/route_info_linux.go
сгенерированный
поставляемый
@@ -1,3 +1,5 @@
|
||||
// +build !android
|
||||
|
||||
package sockaddr
|
||||
|
||||
import (
|
||||
|
||||
Ссылка в новой задаче
Block a user