metafiles

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

metafiles are metadata files related to networking like /etc/hosts etc

Index

Constants

View Source
const CommentChar string = "#"
View Source
const HostsFilePath = "/etc/hosts"

HostsFilePath in unix file os

Variables

View Source
var (
	MaxHostsEntires = 4096
	// LoadAllEntries is a switch when true loads all entries to hybrid storage
	// backend and uses it even if in-memory storage backend was requested
	LoadAllEntries = false
)

Functions

func GetHostsFileDnsData

func GetHostsFileDnsData(storage StorageType) (*hybrid.HybridMap, error)

GetHostsFileDnsData returns the immutable dns data that is constant throughout the program lifecycle and shouldn't be purged by cache etc.

func HandleHostLine

func HandleHostLine(raw string) (ip string, hosts []string)

HandleHostLine a hosts file line

func HasComment

func HasComment(raw string) bool

HasComment check if the line has a comment

func IsComment

func IsComment(raw string) bool

IsComment check if the file is a comment

Types

type StorageType

type StorageType int
const (
	InMemory StorageType = iota
	Hybrid
)

Jump to

Keyboard shortcuts

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