hostsreader

package
v0.0.0-...-0bb60be Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostReader

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

HostReader is the structure for our object.

func New

func New(filename string) *HostReader

New is our constructor.

func (*HostReader) HasChanged

func (me *HostReader) HasChanged() (bool, error)

HasChanged returns true if the given file has changed since our last read - using the mtime of the file to decide.

It allows us to avoid reparsing the file if the contents haven't changed.

func (*HostReader) Hosts

func (me *HostReader) Hosts() (map[string]string, error)

Hosts returns the map of known-hosts and their associated keys

It caches accesses to the file via the `HasChanged` method to speed things up.

Jump to

Keyboard shortcuts

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