gh

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HEAD        = "# FromGhosts Start"
	TAIL        = "# FromGhosts End"
	TIME        = "# UpdateTime: %s"
	LinePattern = "%s\t\t\t%s # %s"
)

Variables

View Source
var (
	REG  *regexp.Regexp = regexp.MustCompile(`# GitHub520 Host Start[\s\S]*# GitHub520 Host End`)
	FLAG string         = "# GitHub520 Host Start"
)

Functions

This section is empty.

Types

type FuncArg

type FuncArg struct {
	IP  string
	Url string
}

type Ghosts

type Ghosts struct {
	// contains filtered or unexported fields
}

func New

func New(urls ...string) *Ghosts

func (*Ghosts) BackupFilePath

func (that *Ghosts) BackupFilePath() string

func (*Ghosts) Gernerate

func (that *Ghosts) Gernerate(toclear bool) (newContent string)

func (*Ghosts) GetHosts

func (that *Ghosts) GetHosts(url string)

func (*Ghosts) HostsFilePath

func (that *Ghosts) HostsFilePath() string

func (*Ghosts) Parse

func (that *Ghosts) Parse(resp []byte)

func (*Ghosts) PingHosts

func (that *Ghosts) PingHosts(ip, url string)

func (*Ghosts) ReadAndBackup

func (that *Ghosts) ReadAndBackup() (content []byte)

func (*Ghosts) Run

func (that *Ghosts) Run(toclear ...bool)

Jump to

Keyboard shortcuts

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