gonet

package
v0.2.5 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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListIpV4s added in v0.2.0

func ListIpV4s() *[]IpAddr

ListIpV4s 获取所有IPv4地址

func ListIpV6s added in v0.2.0

func ListIpV6s() *[]IpAddr

ListIpV6s 获取所有IPv6地址

func Send

func Send(to []string, subject string, body string, info *SmtpInfo) error

Send 发送邮件

Types

type IpAddr added in v0.2.0

type IpAddr struct {
	Name     string
	IpV4s    []string
	IpV6s    []string
	HwAddr   string
	Up       bool
	Loopback bool
}

IpAddr IP地址

func GetIpV4ByName added in v0.2.0

func GetIpV4ByName(name string) *IpAddr

GetIpV4ByName 获取指定名称的IPv4地址

func GetIpV6ByName added in v0.2.0

func GetIpV6ByName(name string) *IpAddr

GetIpV6ByName 获取指定名称的IPv6地址

func (*IpAddr) IpV4 added in v0.2.0

func (ipAddr *IpAddr) IpV4() string

IpV4 获取第一个IPv4地址

func (*IpAddr) IpV6 added in v0.2.0

func (ipAddr *IpAddr) IpV6() string

IpV6 获取第一个IPv6地址

type SmtpInfo

type SmtpInfo struct {
	Host     string `json:"host" xml:"host"`
	Port     string `json:"port" xml:"port"`
	From     string `json:"from" xml:"from"`
	Password string `json:"password" xml:"password"`
}

SmtpInfo SMTP server configuration.

Jump to

Keyboard shortcuts

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