git

package
v0.0.0-...-dec25df Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package git provides the functionality for interacting with git/GitHub.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Url   string // https://github.com/user/repo
	Token string // Github token
}

type Git

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

func NewGit

func NewGit(cfg Config, wg *sync.WaitGroup) (*Git, error)

Creates a new Git instance. Also starts a worker goroutine which will process commits in the background. To properly exit, call Stop(). The passed in WaitGroup is so that we can wait for all pending check ins to complete on exit.

func (*Git) QueueCommit

func (g *Git) QueueCommit(relpath string, content []byte, comment, name, email string, when time.Time)

Queue up a commit, which will be pushed to GitHub in a separate goroutine. Relpath is the part of path inside the repo, e.g. "tables/1/10.yaml", content is the content of this file; comment, name, email and when are attributes of the commit.

func (*Git) Stop

func (g *Git) Stop()

Closes the queue channel thereby informing the git worker goroutine to exit.

func (*Git) Url

func (g *Git) Url() url.URL

Return the URL to the repository.

Jump to

Keyboard shortcuts

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