Documentation ¶
Overview ¶
Package etcd implements sabakan model on etcd.
Index ¶
- Constants
- func NewModel(client *clientv3.Client, dataDir string, advertiseURL *url.URL) sabakan.Model
- type AssetDir
- type EventPool
- type ImageDir
- func (d ImageDir) Download(w io.Writer, id string) error
- func (d ImageDir) Exists(id string) bool
- func (d ImageDir) Extract(r io.Reader, id string, members []string) error
- func (d ImageDir) GC(ids []string) error
- func (d ImageDir) ServeFile(id, filename string, f func(content io.ReadSeeker)) error
- func (d ImageDir) Size(id string) (int64, error)
Constants ¶
const ( KeyVersion = "version" KeySchemaLockPrefix = "schema-lock/" KeyCrypts = "crypts/" KeyDHCP = "dhcp" KeyIPAM = "ipam" KeyLeaseUsages = "lease-usages/" KeyMachines = "machines/" KeyNodeIndices = "node-indices/" KeyImages = "images/" KeyAssets = "assets/" KeyAssetsID = "assets" KeyIgnitions = "ignitions/" KeyAudit = "audit/" KeyAuditLastGC = "audit" KeyKernelParams = "kernel-params/" )
Internal schema keys.
const LastRevFile = "lastrev"
LastRevFile is the filename that keeps the last revision that the stateful watcher processed successfully.
const MaxDeleted = 10
MaxDeleted is the maximum number of deleted image IDs stored in etcd.
const MaxIgnitions = 10
MaxIgnitions is a number of the ignition templates to keep on etcd
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AssetDir ¶
type AssetDir struct {
Dir string
}
AssetDir is a struct to manage the assets directory.
type ImageDir ¶
type ImageDir struct { // Dir is an absolute path to point image directory of an OS. Dir string }
ImageDir is a struct to manage an image directory.
func (ImageDir) Exists ¶
Exists returns true if image files referenced by "id" is stored in the directory.
func (ImageDir) Extract ¶
Extract reads tar archive from "r" to extract files shown in "members".
Extracted files are finally stored under "id" directory. If the tar archive contains a file not in "members", or if the tar archive lacks a file in "members", this function returns sabakan.ErrBadRequest.