healthcheck

package
v0.0.47 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultPathsToCheckPermission   = []string{filepath.Join(folderutil.HomeDirOrDefault(""), ".config", fileutil.ExecutableName())}
	DefaultHostsToCheckConnectivity = []string{"scanme.sh"}
	DefaultResolver                 = "1.1.1.1:53"
)

Functions

This section is empty.

Types

type ConnectionInfo

type ConnectionInfo struct {
	Host       string
	Successful bool
	Message    string
	Error      error
}

func CheckConnection

func CheckConnection(host string, port int, protocol string, timeout time.Duration) ConnectionInfo

type DnsResolveInfo

type DnsResolveInfo struct {
	Host        string
	Resolver    string
	Successful  bool
	IPAddresses []net.IPAddr
	Error       error
}

func DnsResolve

func DnsResolve(host string, resolver string) DnsResolveInfo

type EnvironmentInfo

type EnvironmentInfo struct {
	ExternalIPv4   string
	Admin          bool
	Arch           string
	Compiler       string
	GoVersion      string
	OSName         string
	ProgramVersion string
	OutboundIPv4   string
	OutboundIPv6   string
	Ulimit         Ulimit
	PathEnvVar     string
	Error          error
}

func CollectEnvironmentInfo

func CollectEnvironmentInfo(appVersion string) EnvironmentInfo

type HealthCheckInfo

type HealthCheckInfo struct {
	EnvironmentInfo EnvironmentInfo
	PathPermissions []PathPermission
	DnsResolveInfos []DnsResolveInfo
}

func Do

func Do(programVersion string, options *Options) (healthCheckInfo HealthCheckInfo)

type Options

type Options struct {
	Paths    []string
	Hosts    []string
	Resolver string
}

type PathPermission

type PathPermission struct {
	Error error
	// contains filtered or unexported fields
}

func CheckPathPermission

func CheckPathPermission(path string) (pathPermission PathPermission)

CheckPathPermission checks the permissions of the given file or directory.

type Ulimit

type Ulimit struct {
	Current uint64
	Max     uint64
}

Jump to

Keyboard shortcuts

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