initiate

package
v5.2.0-beta2+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2020 License: LGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrRegistryAddressNotFound record not found error, happens when haven't find any matched registry address.
	ErrRegistryAddressNotFound = errors.New("registry address not found")
)

Functions

This section is empty.

Types

type HostManager

type HostManager interface {
	Start()
}

HostManager is responsible for writing the resolution of the private image repository domain name to /etc/hosts.

func NewHostManager

func NewHostManager(cfg *option.Conf, discover discover.Discover) (HostManager, error)

NewHostManager creates a new HostManager.

type Hosts

type Hosts struct {
	Path  string
	Lines []HostsLine
}

Hosts represents a hosts file.

func NewHosts

func NewHosts(hostsFile string) (Hosts, error)

NewHosts return a new instance of “Hosts“.

func (*Hosts) Add

func (h *Hosts) Add(ip string, hosts ...string)

Add an entry to the hosts file.

func (*Hosts) AddLines

func (h *Hosts) AddLines(lines ...string)

AddLines adds entries to the hosts file.

func (*Hosts) Cleanup

func (h *Hosts) Cleanup() error

Cleanup remove entries created by rainbond from the hosts file.

func (Hosts) Flush

func (h Hosts) Flush() error

Flush any changes made to hosts file.

type HostsLine

type HostsLine struct {
	IP    string
	Hosts []string
	Raw   string
	Err   error
}

HostsLine represents a single line in the hosts file.

func NewHostsLine

func NewHostsLine(raw string) HostsLine

NewHostsLine returns a new instance of ```HostsLine```.

func (HostsLine) IsComment

func (l HostsLine) IsComment() bool

IsComment returns ```true``` if the line is a comment.

Jump to

Keyboard shortcuts

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