branch

package
v0.0.0-...-c5655c4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Branch

type Branch struct {
	// ID of the branch. It is internal, used for identifying branches during sync.
	ID ID `json:"id"`

	// Name of the branch.
	Name string `json:"name"`

	// Tip is the last snapshot on the branch
	Tip *snapshot.Snapshot `json:"tip"`

	// HasChild is true if the tip has child(ren)
	HasChild bool `json:"has_child"`
}

Branch defines a branch object

type ID

type ID string

ID is the opaque, globally unique identifier of a branch.

func NewID

func NewID(s string) ID

NewID creates a ID from a string returned from a previous call to ID.String.

func NewRandomID

func NewRandomID() ID

NewRandomID generates a new unused snapshot identifier at random.

func (*ID) Equals

func (id *ID) Equals(that *ID) bool

Equals ..

func (ID) IsNilID

func (id ID) IsNilID() bool

IsNilID ...

func (ID) String

func (id ID) String() string

String ...

type Query

type Query struct {
	// Query by ID
	ID ID `json:"id"`

	Name     string       `json:"name"`
	VolSetID volumeset.ID `json:"volset_id"`
	// Pagination ..
	Offset int `json:"offset"`
	Limit  int `json:"limit"`

	Search string `json:"search"`
}

Query ..

func (Query) Matches

func (q Query) Matches(b *Branch) bool

Matches ..

func (Query) Validate

func (q Query) Validate() error

Validate ..

type SortableBranchesByTipDepth

type SortableBranchesByTipDepth []*Branch

SortableBranchesByTipDepth is a helper for sorting branches by their tip's depth

func (SortableBranchesByTipDepth) Len

func (SortableBranchesByTipDepth) Less

func (b SortableBranchesByTipDepth) Less(i, j int) bool

func (SortableBranchesByTipDepth) Swap

func (b SortableBranchesByTipDepth) Swap(i, j int)

Jump to

Keyboard shortcuts

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