hostsstore

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package hostsstore provides the interface for /var/lib/nerdctl/<ADDRHASH>/etchosts . Prioritize simplicity over scalability.

Index

Constants

View Source
const (
	MarkerBegin = "<nerdctl>"
	MarkerEnd   = "</nerdctl>"
)

Variables

This section is empty.

Functions

func AllocHostsFile

func AllocHostsFile(dataStore, ns, id string) (string, error)

AllocHostsFile is used for creating mount-bindable /etc/hosts file. The file is initialized with no content.

func DeallocHostsFile

func DeallocHostsFile(dataStore, ns, id string) error

func HostsPath

func HostsPath(dataStore, ns, id string) string

HostsPath returns "/var/lib/nerdctl/<ADDRHASH>/etchosts/<NS>/<ID>/hosts"

Types

type Meta

type Meta struct {
	Namespace  string
	ID         string
	Networks   map[string]*types100.Result
	Hostname   string
	ExtraHosts map[string]string // host:ip
	Name       string
}

type Store

type Store interface {
	Acquire(Meta) error
	Release(ns, id string) error
	Update(ns, id, newName string) error
}

func NewStore

func NewStore(dataStore string) (Store, error)

Jump to

Keyboard shortcuts

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