zone

package
v0.0.0-...-2cf97e7 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RootPointer

type RootPointer struct {
	Version   byte
	Timestamp int64
	Pointer   storage.ID
	Digest    []byte
}

RootPointer implements zone root pointer.

type Suite

type Suite byte

Suite defines an encryption suite.

const (
	// AES256CBCHMACSHA256 defines the AES256-CBC HMAC-SHA256
	// encryption suite.
	AES256CBCHMACSHA256 Suite = 0
)

func (Suite) CipherKeyLen

func (s Suite) CipherKeyLen() int

CipherKeyLen returns the cipher key length.

func (Suite) HMACKeyLen

func (s Suite) HMACKeyLen() int

HMACKeyLen returns the HMAC key length.

func (Suite) IDHashKeyLen

func (s Suite) IDHashKeyLen() int

IDHashKeyLen returns the ID hash key length.

func (Suite) KeyLen

func (s Suite) KeyLen() int

KeyLen returns the cipher suite key length.

func (Suite) String

func (s Suite) String() string

type Zone

type Zone struct {
	Name        string
	Persistence persistence.Accessor
	Head        *tree.Snapshot
	HeadID      storage.ID

	Written uint64
	Saved   uint64
	// contains filtered or unexported fields
}

Zone implements an backup zone.

func Create

func Create(persistence persistence.Accessor, name string) (*Zone, error)

Create creates the zone name to the persistence.

func Open

func Open(persistence persistence.Accessor, name string,
	keys []identity.PrivateKey) (*Zone, error)

Open opens the zone name from the persistence.

func (*Zone) AddIdentity

func (zone *Zone) AddIdentity(key identity.PublicKey) error

AddIdentity adds identity key for the zone.

func (*Zone) Read

func (zone *Zone) Read(id storage.ID) ([]byte, error)

Read implements the storage.Reader interface.

func (*Zone) SetRootPointer

func (zone *Zone) SetRootPointer(id storage.ID) error

SetRootPointer sets the root pointer of the zone to id.

func (*Zone) Write

func (zone *Zone) Write(data []byte) (id storage.ID, err error)

Write implements the storage.Writer interface.

Jump to

Keyboard shortcuts

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