parser

package
v0.0.0-...-ee3260f Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Overview

Package parser parses the hosts file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	Path string
	// contains filtered or unexported fields
}

Parser represents the Host file Parser.

func (*Parser) AddNewMapping

func (p *Parser) AddNewMapping(ip string, domains []string, comment string) error

AddNewMapping method adds a new host entry.

func (*Parser) Init

func (p *Parser) Init() error

Init initialize the parser.

func (*Parser) RemoveDomainFromHostMapping

func (p *Parser) RemoveDomainFromHostMapping(domain string) error

RemoveDomainFromHostMapping removes a domain from an entry.

func (*Parser) RemoveHostMapping

func (p *Parser) RemoveHostMapping(ip string) error

RemoveHostMapping removes an entry.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳