gitbe

package
v0.0.0-...-6d444a5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2018 License: ISC Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Lockfile is the filesystem lock filename.  Export for external utilities.
	LockFilename = ".lock"

	// LockDuration is the maximum lock time duration allowed.  15 seconds
	// is ~3x of anchoring without internet delay.
	LockDuration = 15 * time.Second
)

Variables

This section is empty.

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.

func New

func New(anp *chaincfg.Params, root string, dcrtimeHost string, gitPath string, id *identity.FullIdentity, gitTrace bool) (*gitBackEnd, error)

New returns a gitBackEnd context. It verifies that git is installed.

func UseLogger

func UseLogger(logger btclog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using btclog.

Types

type Anchor

type Anchor struct {
	Type     AnchorType // Type of anchor this record represents
	Time     int64      // OS time when record was created
	Digests  [][]byte   // All digests that were merkled to get to key of record
	Messages []string   // All one-line Commit messages

}

type AnchorType

type AnchorType uint32

AnchorType discriminates between the various Anchor record types.

const (
	AnchorInvalid    AnchorType = 0 // Invalid anchor
	AnchorUnverified AnchorType = 1 // Unverified anchor
	AnchorVerified   AnchorType = 2 // Verified anchor
)

type GitCommit

type GitCommit struct {
	Hash    string
	Time    int64
	Message []string
	Error   error
}

type LastAnchor

type LastAnchor struct {
	Last   []byte // Last git digest that was anchored
	Time   int64  // OS time when record was created
	Merkle []byte // Merkle root that points to Anchor record, if valid
}

LastAnchor stores the last commit anchored in dcrtime.

type UnconfirmedAnchor

type UnconfirmedAnchor struct {
	Merkles [][]byte // List of Merkle root that points to Anchor records
}

UnconfirmedAnchor stores Merkle roots of anchors that have not been confirmed yet by dcrtime.

Jump to

Keyboard shortcuts

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