cid

package
v0.0.0-...-03d6fc4 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2019 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

Package cid contains CommitID and utilities for working with them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitDetail

type CommitDetail struct {
	CommitID
	Author    string `json:"author"`
	Message   string `json:"message"`
	URL       string `json:"url"`
	Hash      string `json:"hash"`
	Timestamp int64  `json:"ts"`
}

CommitDetail describes a CommitID.

type CommitID

type CommitID struct {
	Offset int    `json:"offset"` // The index number of the commit from beginning of time, or the index of the patch number in Reitveld.
	Source string `json:"source"` // The branch name, e.g. "master", or the Reitveld issue id.
}

CommitID represents the time of a particular commit, where a commit could either be a real commit into the repo, or an event like running a trybot.

func FromHash

func FromHash(ctx context.Context, vcs vcsinfo.VCS, hash string) (*CommitID, error)

FromHash returns a CommitID for the given git hash.

func FromID

func FromID(s string) (*CommitID, error)

FromID is the inverse operator to ID().

func (CommitID) Filename

func (c CommitID) Filename() string

Filename returns a safe filename to be used as part of the underlying BoltDB tile name.

func (CommitID) ID

func (c CommitID) ID() string

ID returns a unique ID for the CommitID.

type CommitIDLookup

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

CommitIDLookup allows getting CommitDetails from CommitIDs.

func New

func New(ctx context.Context, git *gitinfo.GitInfo, gitRepoURL string) *CommitIDLookup

func (*CommitIDLookup) Lookup

func (c *CommitIDLookup) Lookup(ctx context.Context, cids []*CommitID) ([]*CommitDetail, error)

Lookup returns a CommitDetail for each CommitID.

Jump to

Keyboard shortcuts

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