git

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(ctx context.Context, logger logging.Logger, committer string, repoURL string) *Client

func (*Client) Clone

func (g *Client) Clone() error

func (*Client) Init

func (g *Client) Init(deploykey []byte) error

func (*Client) Read

func (g *Client) Read(path string) (map[string]interface{}, error)
func (g *Client) Pull() error {
	g.logger.Debug("Pulling")

	err := g.workTree.PullContext(g.ctx, &gogit.PullOptions{
		//			Depth:        1,
		SingleBranch: true,
		RemoteName:   "origin",
		Auth:         g.auth,
		Progress:     g.progress,
		Force:        true,
	})
	if err != nil && !strings.Contains(err.Error(), gogit.NoErrAlreadyUpToDate.Error()) {
		return errors.Wrap(err, "pulling repository failed")
	}

	g.logger.Debug("Repository pulled to worktree")
	return nil
}

func (*Client) UpdateRemoteUntilItWorks

func (g *Client) UpdateRemoteUntilItWorks(file *File) ([]byte, error)

type File

type File struct {
	Path      string
	Overwrite func(map[string]interface{}) ([]byte, error)
	Force     bool
}

type LatestFile

type LatestFile struct {
	Path    string
	Content []byte
}

Jump to

Keyboard shortcuts

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