hostsstore

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

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 []string
	Name       string
}

type Store

type Store interface {
	Acquire(Meta) error
	Release(ns, id 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