zerodisk

package module
v1.1.0-alpha-8 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

README

Zero-OS 0-Disk Build Status

This repository implements the components required for supporting block storage in Zero-OS nodes.

The Zero-OS block storage components allow you to create and use block devices (vdisks) from within virtual machines hosted on a Zero-OS node.

0-Disk overview

A vdisk can be deduped, persistent, redundant and depending on the underlying storage, have different speed characteristics.

Components:

  • NBD Server
    • A network block device (NBD) server to expose the vdisks to virtual machines
  • TLOG Server/Client
    • A transaction log server and client to record block changes
  • zeroctl
    • A command line tool to manage vdisks

Make sure to have Golang version 1.8 or above installed.

More

All documentation is in the /docs directory, including a table of contents and a glossary of terminology used in this project.

All code is also documented, which can be found at godoc.

In Getting Started with NBD Server you find the recommended path to quickly get up and running.

Documentation

Index

Constants

View Source
const (
	//HashSize is the length of a hash in bytes
	HashSize = 32
)

Variables

View Source
var (
	// CurrentVersion represents the current global
	// version of the zerodisk modules
	CurrentVersion = NewVersion(1, 1, 0, VersionStageAlpha)
)
View Source
var (
	//NilHash is a hash with only '0'bytes
	NilHash = NewHash()
)

Functions

This section is empty.

Types

type Hash

type Hash []byte

Hash is just a bytearray of size HashSize

func HashBytes

func HashBytes(data []byte) Hash

HashBytes takes a byte slice and returns a hashed version of it.

func NewHash

func NewHash() (hash Hash)

NewHash initializes a new empty hash

func (Hash) Bytes

func (h Hash) Bytes() []byte

Bytes returns the hash as a slice of bytes

func (Hash) Equals

func (h Hash) Equals(compareTo Hash) bool

Equals returns true if two hashes are the same

type Hasher

type Hasher interface {
	HashBytes([]byte) Hash
}

Hasher is the crypto hasher interface used, for all zerodisk crypto-hash purposes, where we want to reuse a hasher for some reason.

func NewHasher

func NewHasher() (Hasher, error)

NewHasher returns a new instance of the default hasher used in 0-Disk, using the given key.

func NewKeyedHasher

func NewKeyedHasher(key []byte) (Hasher, error)

NewKeyedHasher returns a new instance of the default keyed hasher used in 0-Disk, using the given key.

type Version

type Version uint32

Version defines the semantic version, used by Client and Server.

func NewVersion

func NewVersion(major, minor, patch uint8, stage VersionStage) Version

NewVersion creates a new version

func (Version) Compare

func (v Version) Compare(other Version) int

Compare returns an integer comparing this version with another version. { lt=-1 ; eq=0 ; gt=1 }

func (Version) String

func (v Version) String() string

String returns the string version of this Tlog Version

func (Version) UInt32

func (v Version) UInt32() uint32

UInt32 returns the integral version of this Tlog Version

type VersionStage

type VersionStage uint8

VersionStage defines the stage of the version. This type can also be used to cast a Version to a VersionStage.

const (
	VersionStageLive VersionStage = 1 << iota
	VersionStageRC
	VersionStageBeta
	VersionStageAlpha
	VersionStageDev
)

The different version stages

Directories

Path Synopsis
docs
Package log defines a complete logging API and is to be used for all 0-Disk info/error logging purposes.
Package log defines a complete logging API and is to be used for all 0-Disk info/error logging purposes.
nbd
Package redisstub is a minimal package providing redis-related (in-memory) implementations meant for testing and dev purposes only.
Package redisstub is a minimal package providing redis-related (in-memory) implementations meant for testing and dev purposes only.
tools
cmd

Jump to

Keyboard shortcuts

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