persist

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package persist is a generated protocol buffer package.

It is generated from these files:

server/pfs/db/persist/persist.proto

It has these top-level messages:

Clock
ClockID
Repo
BlockRef
Diff
Commit
ProvenanceCommit

Index

Constants

This section is empty.

Variables

View Source
var FileType_name = map[int32]string{
	0: "NONE",
	1: "FILE",
	2: "DIR",
}
View Source
var FileType_value = map[string]int32{
	"NONE": 0,
	"FILE": 1,
	"DIR":  2,
}

Functions

func ClockEq

func ClockEq(c1 *Clock, c2 *Clock) bool

ClockEq returns if two clocks are equal

func ClockToArray

func ClockToArray(clock gorethink.Term) []interface{}

ClockToArray is the same as Clock.ToArray except that it operates on a gorethink Term

func DBClockAncestor added in v1.2.4

func DBClockAncestor(parent, child gorethink.Term) gorethink.Term

DBClockAncestor returns whether one FullClock is the ancestor of the other, assuming both are rethinkdb terms. A FullClock is the ancestor of itself.

func DBClockDescendent

func DBClockDescendent(child, parent gorethink.Term) gorethink.Term

DBClockDescendent returns whether one FullClock is the descendent of the other, assuming both are rethinkdb terms

func FullClockBranch

func FullClockBranch(fc FullClock) string

FullClockBranch returns the branch of the last element of the FullClock

func FullClockToArray

func FullClockToArray(fullClock gorethink.Term) gorethink.Term

FullClockToArray converts a FullClock to an array.

func NewCommitID

func NewCommitID(repo string, clock *Clock) string

NewCommitID generates a commitID to be used in a database from a repo and a clock

Types

type BlockRef

type BlockRef struct {
	Hash  string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
	Lower uint64 `protobuf:"varint,2,opt,name=lower,proto3" json:"lower,omitempty"`
	Upper uint64 `protobuf:"varint,3,opt,name=upper,proto3" json:"upper,omitempty"`
}

func (*BlockRef) Descriptor

func (*BlockRef) Descriptor() ([]byte, []int)

func (*BlockRef) GetHash added in v1.3.5

func (m *BlockRef) GetHash() string

func (*BlockRef) GetLower added in v1.3.5

func (m *BlockRef) GetLower() uint64

func (*BlockRef) GetUpper added in v1.3.5

func (m *BlockRef) GetUpper() uint64

func (*BlockRef) ProtoMessage

func (*BlockRef) ProtoMessage()

func (*BlockRef) Reset

func (m *BlockRef) Reset()

func (*BlockRef) Size

func (b *BlockRef) Size() uint64

Size returns the size of a block ref

func (*BlockRef) String

func (m *BlockRef) String() string

type Clock

type Clock struct {
	// a document either has these two fields
	Branch string `protobuf:"bytes,1,opt,name=branch,proto3" json:"branch,omitempty"`
	Clock  uint64 `protobuf:"varint,2,opt,name=clock,proto3" json:"clock,omitempty"`
}

func CloneClock

func CloneClock(c *Clock) *Clock

CloneClock clones a clock

func CloneFullClock

func CloneFullClock(fc []*Clock) []*Clock

CloneFullClock clones a FullClock

func FullClockHead

func FullClockHead(fc FullClock) *Clock

FullClockHead returns the last element of a FullClock

func NewClock

func NewClock(branch string) *Clock

NewClock returns a new clock for a given branch

func StringToClock

func StringToClock(s string) (*Clock, error)

StringToClock converts a string like "master/2" to a clock

func (*Clock) Descriptor

func (*Clock) Descriptor() ([]byte, []int)

func (*Clock) GetBranch added in v1.3.5

func (m *Clock) GetBranch() string

func (*Clock) GetClock added in v1.3.5

func (m *Clock) GetClock() uint64

func (*Clock) ProtoMessage

func (*Clock) ProtoMessage()

func (*Clock) ReadableCommitID

func (c *Clock) ReadableCommitID() string

ReadableCommitID returns a human-friendly commit ID for displaying purposes.

func (*Clock) Reset

func (m *Clock) Reset()

func (*Clock) String

func (m *Clock) String() string

func (*Clock) ToArray

func (c *Clock) ToArray() []interface{}

ToArray converts a clock to an array

type ClockID

type ClockID struct {
	ID     string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Repo   string `protobuf:"bytes,2,opt,name=repo,proto3" json:"repo,omitempty"`
	Branch string `protobuf:"bytes,3,opt,name=branch,proto3" json:"branch,omitempty"`
	Clock  uint64 `protobuf:"varint,4,opt,name=clock,proto3" json:"clock,omitempty"`
}

func (*ClockID) Descriptor

func (*ClockID) Descriptor() ([]byte, []int)

func (*ClockID) GetBranch added in v1.3.5

func (m *ClockID) GetBranch() string

func (*ClockID) GetClock added in v1.3.5

func (m *ClockID) GetClock() uint64

func (*ClockID) GetID added in v1.3.5

func (m *ClockID) GetID() string

func (*ClockID) GetRepo added in v1.3.5

func (m *ClockID) GetRepo() string

func (*ClockID) ProtoMessage

func (*ClockID) ProtoMessage()

func (*ClockID) Reset

func (m *ClockID) Reset()

func (*ClockID) String

func (m *ClockID) String() string

type ClockRange

type ClockRange struct {
	Branch string
	Left   uint64
	Right  uint64
}

ClockRange represents a range of clocks

type ClockRangeList

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

ClockRangeList is an ordered list of ClockRanges

func NewClockRangeList

func NewClockRangeList(from FullClock, to FullClock) ClockRangeList

NewClockRangeList creates a ClockRangeList that represents all clock ranges in between the two given FullClocks.

func (*ClockRangeList) AddClock

func (l *ClockRangeList) AddClock(c *Clock)

AddClock adds a range [0, c.Clock]

func (*ClockRangeList) AddFullClock

func (l *ClockRangeList) AddFullClock(fc FullClock)

AddFullClock adds a FullClock to the ClockRange

func (*ClockRangeList) Ranges

func (l *ClockRangeList) Ranges() []*ClockRange

Ranges return the clock ranges stored in a ClockRangeList

func (*ClockRangeList) SubClock

func (l *ClockRangeList) SubClock(c *Clock)

SubClock substracts a range [0, c.Clock]

func (*ClockRangeList) SubFullClock

func (l *ClockRangeList) SubFullClock(fc FullClock)

SubFullClock subtracts a FullClock from the ClockRange

type Commit

type Commit struct {
	ID        string                     `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Repo      string                     `protobuf:"bytes,2,opt,name=repo,proto3" json:"repo,omitempty"`
	FullClock []*Clock                   `protobuf:"bytes,3,rep,name=full_clock,json=fullClock" json:"full_clock,omitempty"`
	Started   *google_protobuf.Timestamp `protobuf:"bytes,4,opt,name=started" json:"started,omitempty"`
	Finished  *google_protobuf.Timestamp `protobuf:"bytes,5,opt,name=finished" json:"finished,omitempty"`
	Cancelled bool                       `protobuf:"varint,6,opt,name=cancelled,proto3" json:"cancelled,omitempty"`
	Archived  bool                       `protobuf:"varint,7,opt,name=archived,proto3" json:"archived,omitempty"`
	// The complete set of commits that are the provenance of this commit.
	// We store the complete set of provenance as opposed to just the immediate
	// provenance in order to make ListCommit(provenance) fast.
	Provenance []*ProvenanceCommit `protobuf:"bytes,8,rep,name=provenance" json:"provenance,omitempty"`
	SizeBytes  uint64              `protobuf:"varint,9,opt,name=size_bytes,json=sizeBytes,proto3" json:"size_bytes,omitempty"`
}

func (*Commit) Descriptor

func (*Commit) Descriptor() ([]byte, []int)

func (*Commit) GetArchived added in v1.3.5

func (m *Commit) GetArchived() bool

func (*Commit) GetCancelled added in v1.3.5

func (m *Commit) GetCancelled() bool

func (*Commit) GetFinished

func (m *Commit) GetFinished() *google_protobuf.Timestamp

func (*Commit) GetFullClock

func (m *Commit) GetFullClock() []*Clock

func (*Commit) GetID added in v1.3.5

func (m *Commit) GetID() string

func (*Commit) GetProvenance

func (m *Commit) GetProvenance() []*ProvenanceCommit

func (*Commit) GetRepo added in v1.3.5

func (m *Commit) GetRepo() string

func (*Commit) GetSizeBytes added in v1.3.5

func (m *Commit) GetSizeBytes() uint64

func (*Commit) GetStarted

func (m *Commit) GetStarted() *google_protobuf.Timestamp

func (*Commit) ProtoMessage

func (*Commit) ProtoMessage()

func (*Commit) Reset

func (m *Commit) Reset()

func (*Commit) String

func (m *Commit) String() string

type Diff

type Diff struct {
	ID   string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Repo string `protobuf:"bytes,2,opt,name=repo,proto3" json:"repo,omitempty"`
	Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
	// block_refs and delete cannot both be set
	BlockRefs []*BlockRef                `protobuf:"bytes,4,rep,name=block_refs,json=blockRefs" json:"block_refs,omitempty"`
	Delete    bool                       `protobuf:"varint,5,opt,name=delete,proto3" json:"delete,omitempty"`
	SizeBytes uint64                     `protobuf:"varint,6,opt,name=size_bytes,json=sizeBytes,proto3" json:"size_bytes,omitempty"`
	Clock     []*Clock                   `protobuf:"bytes,7,rep,name=clock" json:"clock,omitempty"`
	FileType  FileType                   `protobuf:"varint,8,opt,name=file_type,json=fileType,proto3,enum=FileType" json:"file_type,omitempty"`
	Modified  *google_protobuf.Timestamp `protobuf:"bytes,9,opt,name=modified" json:"modified,omitempty"`
}

func (*Diff) CommitID

func (d *Diff) CommitID() string

CommitID returns the CommitID of the clock associated with the diff

func (*Diff) Descriptor

func (*Diff) Descriptor() ([]byte, []int)

func (*Diff) GetBlockRefs

func (m *Diff) GetBlockRefs() []*BlockRef

func (*Diff) GetClock

func (m *Diff) GetClock() []*Clock

func (*Diff) GetDelete added in v1.3.5

func (m *Diff) GetDelete() bool

func (*Diff) GetFileType added in v1.3.5

func (m *Diff) GetFileType() FileType

func (*Diff) GetID added in v1.3.5

func (m *Diff) GetID() string

func (*Diff) GetModified

func (m *Diff) GetModified() *google_protobuf.Timestamp

func (*Diff) GetPath added in v1.3.5

func (m *Diff) GetPath() string

func (*Diff) GetRepo added in v1.3.5

func (m *Diff) GetRepo() string

func (*Diff) GetSizeBytes added in v1.3.5

func (m *Diff) GetSizeBytes() uint64

func (*Diff) ProtoMessage

func (*Diff) ProtoMessage()

func (*Diff) Reset

func (m *Diff) Reset()

func (*Diff) String

func (m *Diff) String() string

type FileType

type FileType int32
const (
	FileType_NONE FileType = 0
	FileType_FILE FileType = 1
	FileType_DIR  FileType = 2
)

func (FileType) EnumDescriptor

func (FileType) EnumDescriptor() ([]byte, []int)

func (FileType) String

func (x FileType) String() string

type FullClock

type FullClock []*Clock

FullClock is an array of clocks, e.g. [(master, 2), (foo, 3)]

func FullClockParent

func FullClockParent(child FullClock) FullClock

FullClockParent returns the parent of a full clock, or nil if the clock has no parent [(master, 2), (foo, 1)] -> [(master, 2), (foo, 0)] [(master, 2), (foo, 0)] -> [(master, 2)]

func NewChild

func NewChild(parent FullClock) FullClock

NewChild returns the child of a FullClock [(master, 0), (foo, 0)] -> [(master, 0), (foo, 1)]

type ProvenanceCommit

type ProvenanceCommit struct {
	ID   string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Repo string `protobuf:"bytes,2,opt,name=repo,proto3" json:"repo,omitempty"`
}

func (*ProvenanceCommit) Descriptor

func (*ProvenanceCommit) Descriptor() ([]byte, []int)

func (*ProvenanceCommit) GetID added in v1.3.5

func (m *ProvenanceCommit) GetID() string

func (*ProvenanceCommit) GetRepo added in v1.3.5

func (m *ProvenanceCommit) GetRepo() string

func (*ProvenanceCommit) ProtoMessage

func (*ProvenanceCommit) ProtoMessage()

func (*ProvenanceCommit) Reset

func (m *ProvenanceCommit) Reset()

func (*ProvenanceCommit) String

func (m *ProvenanceCommit) String() string

type Repo

type Repo struct {
	Name      string                     `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Created   *google_protobuf.Timestamp `protobuf:"bytes,2,opt,name=created" json:"created,omitempty"`
	SizeBytes uint64                     `protobuf:"varint,3,opt,name=size_bytes,json=sizeBytes,proto3" json:"size_bytes,omitempty"`
	// The immediate provenance of this repo
	Provenance []string `protobuf:"bytes,4,rep,name=provenance" json:"provenance,omitempty"`
}

func (*Repo) Descriptor

func (*Repo) Descriptor() ([]byte, []int)

func (*Repo) GetCreated

func (m *Repo) GetCreated() *google_protobuf.Timestamp

func (*Repo) GetName added in v1.3.5

func (m *Repo) GetName() string

func (*Repo) GetProvenance added in v1.3.5

func (m *Repo) GetProvenance() []string

func (*Repo) GetSizeBytes added in v1.3.5

func (m *Repo) GetSizeBytes() uint64

func (*Repo) ProtoMessage

func (*Repo) ProtoMessage()

func (*Repo) Reset

func (m *Repo) Reset()

func (*Repo) String

func (m *Repo) String() string

Jump to

Keyboard shortcuts

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