network

package
v0.0.0-...-fb1bee7 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAvailablePort

func GetAvailablePort() (int, error)

func GetInterfaceFirst

func GetInterfaceFirst() (string, error)

func GetInterfaceIPList

func GetInterfaceIPList(filters ...func(string) bool) ([]string, error)

func GetInterfaceIPv4First

func GetInterfaceIPv4First() (string, error)

func GetInterfaceIPv6First

func GetInterfaceIPv6First() (string, error)

func GetLocalareaIP

func GetLocalareaIP(network, address string) (string, error)

func IsPortAvailable

func IsPortAvailable(port int) bool

Types

type Config

type Config struct {
	AccessIP   string `json:"access_ip" toml:"access_ip" mapstructure:"access_ip"`
	BindIP     string `json:"bind_ip" toml:"bind_ip" mapstructure:"bind_ip"`
	BindPort   int    `json:"bind_port" toml:"bind_port" mapstructure:"bind_port"`
	DisableTLS bool   `json:"disable_tls" toml:"-" mapstructure:"-"`
}

func (*Config) String

func (c *Config) String() string

func (*Config) VerifyConfig

func (c *Config) VerifyConfig() error

type IPType

type IPType int
const (
	IPV4 IPType = iota
	IPV6
)

Jump to

Keyboard shortcuts

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