core

package
v4.12.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2018 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const BackupMetadataTypeCode = 30
View Source
const CephObjectTypeCode = 20
View Source
const EtcdRecordsTypeCode = 10

type code = 1

View Source
const MaxFileSize = 2 * 1024 * 1024 * 1024

Variables

View Source
var Sentinel = []byte{0xbd, 0xdb, 0x55, 0xaa}

Functions

func ChkErr

func ChkErr(err error)

func Clear

func Clear(c *cli.Context) error

func Create

func Create(c *cli.Context) error

func Inspect

func Inspect(c *cli.Context) error

func IsEmpty

func IsEmpty(name string) (bool, error)

func ReadIncrementalMetadata

func ReadIncrementalMetadata(fw *FrameWriter, olddir string)

func Restore

func Restore(c *cli.Context) error

Types

type BackupMetadata

type BackupMetadata struct {
	NumberOfFiles int
	Timestamps    []TimestampEntry
}

func (*BackupMetadata) GetType

func (bm *BackupMetadata) GetType() int

func (*BackupMetadata) MarshalMsg

func (z *BackupMetadata) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*BackupMetadata) Msgsize

func (z *BackupMetadata) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*BackupMetadata) UnmarshalMsg

func (z *BackupMetadata) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type CephObject

type CephObject struct {
	OMAPData  []KeyValue
	XATTRData []KeyValue
	Content   []byte
	Name      string
	Namespace string
	Pool      string
}

func (*CephObject) GetType

func (c *CephObject) GetType() int

func (*CephObject) MarshalMsg

func (z *CephObject) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*CephObject) Msgsize

func (z *CephObject) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*CephObject) UnmarshalMsg

func (z *CephObject) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Container

type Container interface {
	msgp.Marshaler
	GetType() int
}

type EtcdRecords

type EtcdRecords struct {
	KVz []KeyValue
}

func (*EtcdRecords) GetType

func (e *EtcdRecords) GetType() int

func (*EtcdRecords) MarshalMsg

func (z *EtcdRecords) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*EtcdRecords) Msgsize

func (z *EtcdRecords) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*EtcdRecords) UnmarshalMsg

func (z *EtcdRecords) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Frame

type Frame struct {
	Type    int
	Content []byte
}

A backup archive consists of N numbered files and a header file. To recover the backup, you process the N numbered files in order. Each of them has an arbitrary number of frames inside and each one describes an operation on ceph or a set of operations on etcd. Each frame is individually encrypted with GCM

type FrameWriter

type FrameWriter struct {
	// contains filtered or unexported fields
}

func NewFrameWriter

func NewFrameWriter(passphrase string) *FrameWriter

func (*FrameWriter) Read

func (fw *FrameWriter) Read(in io.Reader) (*Frame, error)

func (*FrameWriter) Write

func (fw *FrameWriter) Write(to io.Writer, Type int, Content []byte) error

type KeyValue

type KeyValue struct {
	Key   string
	Value []byte
}

func (*KeyValue) MarshalMsg

func (z *KeyValue) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*KeyValue) Msgsize

func (z *KeyValue) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*KeyValue) UnmarshalMsg

func (z *KeyValue) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type MK

type MK struct {
	Pool      string
	Namespace string
	OID       string
}

func (MK) MarshalMsg

func (z MK) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (MK) Msgsize

func (z MK) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*MK) UnmarshalMsg

func (z *MK) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ProcessArgs

type ProcessArgs struct {
	CephConf      string
	PoolsToBackup []string
}

type Sharder

type Sharder struct {
	// contains filtered or unexported fields
}

func NewReadSharder

func NewReadSharder(fw *FrameWriter, directory string) *Sharder

func NewWriteSharder

func NewWriteSharder(fw *FrameWriter) *Sharder

func (*Sharder) Close

func (s *Sharder) Close()

func (*Sharder) Metadata

func (s *Sharder) Metadata() *BackupMetadata

func (*Sharder) Read

func (s *Sharder) Read() (Container, bool)

func (*Sharder) Write

func (s *Sharder) Write(c Container)

func (*Sharder) WriteMeta

func (s *Sharder) WriteMeta(c Container)

type TimestampEntry

type TimestampEntry struct {
	Key MK
	Val int64
}

func (*TimestampEntry) MarshalMsg

func (z *TimestampEntry) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*TimestampEntry) Msgsize

func (z *TimestampEntry) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*TimestampEntry) UnmarshalMsg

func (z *TimestampEntry) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

Jump to

Keyboard shortcuts

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