persist

package
v1.1.0-RC1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2016 License: Apache-2.0 Imports: 7 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 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.

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) Descriptor() ([]byte, []int)

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" json:"branch,omitempty"`
	Clock  uint64 `protobuf:"varint,2,opt,name=clock" json:"clock,omitempty"`
}

func CloneClock

func CloneClock(c *Clock) *Clock

CloneClock clones a clock

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) ProtoMessage

func (*Clock) ProtoMessage()

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

func (*Clock) ToCommitID

func (c *Clock) ToCommitID() string

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

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) Descriptor() ([]byte, []int)

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" 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) Descriptor() ([]byte, []int)

func (*Commit) GetFinished

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

func (*Commit) GetFullClock

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

func (*Commit) GetProvenance

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

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" 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,opt,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) 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) GetModified

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

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" 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) Descriptor() ([]byte, []int)

func (*Repo) GetCreated

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

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