lib

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger = ILogger{}

Functions

func CheckIPv4Format added in v0.1.2

func CheckIPv4Format(ip string) error

func GetConfigFilePath

func GetConfigFilePath() (string, error)

func GetIPv4

func GetIPv4() (string, error)

func GetIPv4ByUrl

func GetIPv4ByUrl(url string) (string, error)

func SendEmail

func SendEmail(subject string, content string) error

func SendIPChangeEmail added in v0.1.2

func SendIPChangeEmail(newIP string, oldIP string) error

func SendStartupEmail added in v0.1.2

func SendStartupEmail(newIP string) error

Types

type IConfig

type IConfig struct {
	Ip    IIPConfig    `yaml:"ip"`
	Email IEmailConfig `yaml:"email"`
}
var Config *IConfig = nil

func GetConfig

func GetConfig() *IConfig

type IEmailConfig

type IEmailConfig struct {
	SMTPHost   string   `yaml:"smtp_host"`
	SMTPPort   int      `yaml:"smtp_port"`
	SMTPUser   string   `yaml:"smtp_user"`
	SMTPPasswd string   `yaml:"smtp_passwd"`
	From       string   `yaml:"from"`
	To         []string `yaml:"to"`
}

type IIPConfig

type IIPConfig struct {
	QueryUrls []string `yaml:"query_urls"`
	Interval  string   `yaml:"interval"`
}

type ILogger

type ILogger struct {
}

func (*ILogger) Error

func (own *ILogger) Error(err interface{})

func (*ILogger) Info

func (own *ILogger) Info(content interface{})

func (*ILogger) PanicError

func (own *ILogger) PanicError(err error)

func (*ILogger) Println

func (own *ILogger) Println(loggerType string, content interface{})

Jump to

Keyboard shortcuts

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