arq_types

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STORAGE_TYPE_S3      = uint32(1)
	STORAGE_TYPE_GLACIER = uint32(2)
)
View Source
const (
	READ_IS_COMPRESSED        = true
	DO_NOT_READ_IS_COMPRESSED = false
)
View Source
const (
	BLOB_TYPE_TREE       = iota
	BLOB_TYPE_COMMIT     = iota
	BLOB_TYPE_X_ATTR_SET = iota
)

Variables

View Source
var (
	LOCATION_REGEXP = regexp.MustCompile("^file://(?P<computer>[^/]+)(?P<path>.*)$")
)

Functions

func ReadStringAsSHA1

func ReadStringAsSHA1(p *bytes.Buffer) (*[20]byte, error)

Types

type BlobKey

type BlobKey struct {
	Header *Header
	SHA1   *[20]byte

	// only present for Tree v14 or later or Commit v4 or later
	// applies for both trees and commits
	IsEncryptionKeyStretched *Boolean

	// only present for Commit v8 or later
	// only for a Tree BlobKey, not for ParentCommit BlobKey
	IsCompressed *Boolean

	// only for tree v17 or later
	StorageType         uint32
	ArchiveId           *String
	ArchiveSize         uint64
	ArchiveUploadedDate *Date
}

func ReadBlobKey

func ReadBlobKey(p *bytes.Buffer, h *Header, readIsCompressed bool) (blobKey *BlobKey, err error)

func (BlobKey) String

func (b BlobKey) String() string

type Boolean

type Boolean struct {
	IsPresent bool
	Data      bool
}

func ReadBoolean

func ReadBoolean(p *bytes.Buffer) (boolean *Boolean, err error)

func (*Boolean) IsTrue

func (b *Boolean) IsTrue() bool

func (Boolean) String

func (b Boolean) String() string

type Commit

type Commit struct {
	Header        *Header
	Author        *String
	Comment       *String
	ParentCommits []*BlobKey
	TreeBlobKey   *BlobKey

	Location *String
	// These fields aren't part of the file, but are derived fields of Location
	Computer string
	Path     string

	// only present for Commit v7 or older, never used
	MergeCommonAncestorSHA1 *String

	// only present for Commit v4 to v7
	IsMergeCommonAncestorEncryptionKeyStretched *Boolean

	CreationDate      *Date
	CommitFailedFiles []*CommitFailedFile

	// only present for Commit v8 or later
	HasMissingNodes *Boolean

	// only present for Commit v9 or later
	IsComplete *Boolean

	// a copy of the XML file as described in s3_data_format.txt
	ConfigPlistXML *Data
}

func ReadCommit

func ReadCommit(p *bytes.Buffer) (commit *Commit, err error)

func (Commit) String

func (c Commit) String() string

type CommitFailedFile

type CommitFailedFile struct {
	RelativePath *String
	ErrorMessage *String
}

Only present for Commit v3 or later

func ReadCommitFailedFile

func ReadCommitFailedFile(p *bytes.Buffer) (commitFailedFile *CommitFailedFile, err error)

func (CommitFailedFile) String

func (cff CommitFailedFile) String() string

type Data

type Data struct {
	IsPresent bool
	Data      []byte
}

func ReadData

func ReadData(p *bytes.Buffer) (data *Data, err error)

func (Data) String

func (d Data) String() string

type Date

type Date struct {
	IsPresent bool
	Data      time.Time
}

func ReadDate

func ReadDate(p *bytes.Buffer) (date *Date, err error)

func (Date) String

func (d Date) String() string
type Header struct {
	Data    []byte
	Type    int
	Version int
}

func ReadHeader

func ReadHeader(p *bytes.Buffer) (header *Header, err error)

CommitV000 TreeV000 XAttrSetV000

func (Header) String

func (h Header) String() string

type Node

type Node struct {
	Name                     *String
	TreeVersion              int
	IsTree                   *Boolean
	TreeContainsMissingItems *Boolean
	DataAreCompressed        *Boolean
	XattrsAreCompressed      *Boolean
	AclIsCompressed          *Boolean
	DataBlobKeys             []*BlobKey
	UncompressedDataSize     uint64
	ThumbnailBlobKey         *BlobKey
	PreviewBlobKey           *BlobKey
	XattrsBlobKey            *BlobKey
	XattrsSize               uint64
	AclBlobKey               *BlobKey
	Uid                      int32
	Gid                      int32
	Mode                     os.FileMode
	MtimeSec                 int64
	MtimeNsec                int64
	Flags                    int64
	FinderFlags              int32
	ExtendedFinderFlags      int32
	FinderFileType           *String
	FinderFileCreator        *String
	FileExtensionHidden      *Boolean
	StDev                    int32
	StIno                    int32
	StNlink                  uint32
	StRdev                   int32
	CtimeSec                 int64
	CtimeNsec                int64
	CreateTimeSec            int64
	CreateTimeNsec           int64
	StBlocks                 int64
	StBlksize                uint32
}

func ReadNode

func ReadNode(p *bytes.Buffer, treeHeader *Header) (node *Node, err error)

func ReadNodes

func ReadNodes(p *bytes.Buffer, treeHeader *Header) (nodes []*Node, err error)

func (*Node) PrintOutput

func (n *Node) PrintOutput()

func (Node) String

func (n Node) String() string

type String

type String struct {
	Data []byte
}

func NewString added in v0.1.1

func NewString(s string) *String

func ReadString

func ReadString(p *bytes.Buffer) (*String, error)

func (*String) Equal

func (s *String) Equal(o string) bool

func (String) String

func (s String) String() string

func (String) ToString added in v0.1.1

func (s String) ToString() string

type Tree

type Tree struct {
	Header *Header

	// Only present for Tree v12 or later
	XattrsAreCompressed *Boolean

	// Only present for Tree v12 or later
	AclIsCompressed *Boolean

	XattrsBlobKey       *BlobKey
	XattrsSize          uint64
	AclBlobKey          *BlobKey
	Uid                 int32
	Gid                 int32
	Mode                os.FileMode
	MtimeSec            int64
	MtimeNsec           int64
	Flags               int64
	FinderFlags         int32
	ExtendedFinderFlags int32
	StDev               int32
	StIno               int32
	StNlink             uint32
	StRdev              int32
	CtimeSec            int64
	CtimeNsec           int64
	StBlocks            int64
	StBlksize           uint32

	// Only present for Tree v11 to v16
	AggregateSizeOnDisk uint64

	// Only present for Tree v15 or later
	CreateTimeSec int64

	// Only present for Tree v15 or later
	CreateTimeNsec int64

	// Only present for Tree v18 or later
	MissingNodes []*Node

	Nodes []*Node
}

func ReadTree

func ReadTree(p *bytes.Buffer) (tree *Tree, err error)

func (*Tree) PrintOutput

func (t *Tree) PrintOutput(n *Node)

func (Tree) String

func (c Tree) String() string

type TreeNode

type TreeNode struct {
	Filename *String
}

Only present for Commit v3 or later

func ReadTreeNode

func ReadTreeNode(p *bytes.Buffer) (treeNode *TreeNode, err error)

func (TreeNode) String

func (n TreeNode) String() string

Jump to

Keyboard shortcuts

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