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 ¶
- Variables
- func ClockEq(c1 *Clock, c2 *Clock) bool
- func ClockToArray(clock gorethink.Term) []interface{}
- func DBClockDescendent(child, parent gorethink.Term) gorethink.Term
- func FullClockBranch(fc FullClock) string
- func FullClockToArray(fullClock gorethink.Term) gorethink.Term
- func NewCommitID(repo string, clock *Clock) string
- type BlockRef
- type Clock
- type ClockID
- type ClockRange
- type ClockRangeList
- type Commit
- func (*Commit) Descriptor() ([]byte, []int)
- func (m *Commit) GetFinished() *google_protobuf.Timestamp
- func (m *Commit) GetFullClock() []*Clock
- func (m *Commit) GetProvenance() []*ProvenanceCommit
- func (m *Commit) GetStarted() *google_protobuf.Timestamp
- func (*Commit) ProtoMessage()
- func (m *Commit) Reset()
- func (m *Commit) String() string
- type Diff
- type FileType
- type FullClock
- type ProvenanceCommit
- type Repo
Constants ¶
This section is empty.
Variables ¶
var FileType_name = map[int32]string{
0: "NONE",
1: "FILE",
2: "DIR",
}
var FileType_value = map[string]int32{
"NONE": 0,
"FILE": 1,
"DIR": 2,
}
Functions ¶
func ClockToArray ¶
ClockToArray is the same as Clock.ToArray except that it operates on a gorethink Term
func DBClockDescendent ¶
DBClockDescendent returns whether one FullClock is the descendent of the other, assuming both are rethinkdb terms
func FullClockBranch ¶
FullClockBranch returns the branch of the last element of the FullClock
func FullClockToArray ¶
FullClockToArray converts a FullClock to an array.
func NewCommitID ¶
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" json:"hash,omitempty"` Lower uint64 `protobuf:"varint,2,opt,name=lower" json:"lower,omitempty"` Upper uint64 `protobuf:"varint,3,opt,name=upper" json:"upper,omitempty"` }
func (*BlockRef) Descriptor ¶
func (*BlockRef) ProtoMessage ¶
func (*BlockRef) ProtoMessage()
type Clock ¶
type Clock struct { // a document either has these two fields Branch string `protobuf:"bytes,1,opt,name=branch" json:"branch,omitempty"` Clock uint64 `protobuf:"varint,2,opt,name=clock" json:"clock,omitempty"` }
func FullClockHead ¶
FullClockHead returns the last element of a FullClock
func StringToClock ¶
StringToClock converts a string like "master/2" to a clock
func (*Clock) Descriptor ¶
func (*Clock) ProtoMessage ¶
func (*Clock) ProtoMessage()
func (*Clock) ReadableCommitID ¶
ReadableCommitID returns a human-friendly commit ID for displaying purposes.
type ClockID ¶
type ClockID struct { ID string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` Repo string `protobuf:"bytes,2,opt,name=repo" json:"repo,omitempty"` Branch string `protobuf:"bytes,3,opt,name=branch" json:"branch,omitempty"` Clock uint64 `protobuf:"varint,4,opt,name=clock" json:"clock,omitempty"` }
func (*ClockID) Descriptor ¶
func (*ClockID) ProtoMessage ¶
func (*ClockID) ProtoMessage()
type ClockRange ¶
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" json:"id,omitempty"` Repo string `protobuf:"bytes,2,opt,name=repo" 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" json:"cancelled,omitempty"` Archived bool `protobuf:"varint,7,opt,name=archived" 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"` Size uint64 `protobuf:"varint,9,opt,name=size" json:"size,omitempty"` }
func (*Commit) Descriptor ¶
func (*Commit) GetFinished ¶
func (m *Commit) GetFinished() *google_protobuf.Timestamp
func (*Commit) GetFullClock ¶
func (*Commit) GetProvenance ¶
func (m *Commit) GetProvenance() []*ProvenanceCommit
func (*Commit) GetStarted ¶
func (m *Commit) GetStarted() *google_protobuf.Timestamp
func (*Commit) ProtoMessage ¶
func (*Commit) ProtoMessage()
type Diff ¶
type Diff struct { ID string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` Repo string `protobuf:"bytes,2,opt,name=repo" json:"repo,omitempty"` Path string `protobuf:"bytes,3,opt,name=path" 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" json:"delete,omitempty"` Size uint64 `protobuf:"varint,6,opt,name=size" json:"size,omitempty"` Clock []*Clock `protobuf:"bytes,7,rep,name=clock" json:"clock,omitempty"` FileType FileType `protobuf:"varint,8,opt,name=file_type,json=fileType,enum=FileType" json:"file_type,omitempty"` Modified *google_protobuf.Timestamp `protobuf:"bytes,9,opt,name=modified" json:"modified,omitempty"` }
func (*Diff) Descriptor ¶
func (*Diff) GetBlockRefs ¶
func (*Diff) GetModified ¶
func (m *Diff) GetModified() *google_protobuf.Timestamp
func (*Diff) ProtoMessage ¶
func (*Diff) ProtoMessage()
type FullClock ¶
type FullClock []*Clock
FullClock is an array of clocks, e.g. [(master, 2), (foo, 3)]
func FullClockParent ¶
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)]
type ProvenanceCommit ¶
type ProvenanceCommit struct { ID string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` Repo string `protobuf:"bytes,2,opt,name=repo" json:"repo,omitempty"` }
func (*ProvenanceCommit) Descriptor ¶
func (*ProvenanceCommit) Descriptor() ([]byte, []int)
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" json:"name,omitempty"` Created *google_protobuf.Timestamp `protobuf:"bytes,2,opt,name=created" json:"created,omitempty"` Size uint64 `protobuf:"varint,3,opt,name=size" json:"size,omitempty"` // The immediate provenance of this repo Provenance []string `protobuf:"bytes,4,rep,name=provenance" json:"provenance,omitempty"` }
func (*Repo) Descriptor ¶
func (*Repo) GetCreated ¶
func (m *Repo) GetCreated() *google_protobuf.Timestamp
func (*Repo) ProtoMessage ¶
func (*Repo) ProtoMessage()