api

package
v0.0.0-...-3b5ec37 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2018 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnection

func NewConnection(w http.ResponseWriter, r *http.Request, f func(*Connection) error) error

Types

type API

type API struct {
	*Connection
	// contains filtered or unexported fields
}

func (*API) Commit

func (rpc *API) Commit(repoOwner, repoName, message string) error

func (*API) CommitAll

func (rpc *API) CommitAll(repoOwner, repoName, message, notes string) error

func (*API) CommitOnly

func (rpc *API) CommitOnly(repoOwner, repoName, message, notes string) error

func (*API) Defer

func (a *API) Defer(f func())

func (*API) FileExists

func (rpc *API) FileExists(repoOwner, repoName, path string) (bool, error)

func (*API) FileExistsOurHeadTheirHead

func (rpc *API) FileExistsOurHeadTheirHead(repoOwner, repoName, path string) (bool, bool, error)

func (*API) FindFileLists

func (rpc *API) FindFileLists(repoOwner, repoName string) ([]string, error)

func (*API) GetFile

func (rpc *API) GetFile(repoOwner, repoName, path string) ([]byte, error)

GetFile gets the contents of the file at path in the repo.

func (*API) GetFileString

func (rpc *API) GetFileString(repoOwner, repoName, path string) (string, error)

func (*API) Git

func (a *API) Git(owner, name string) (*git.Git, error)

func (*API) IsOurHeadInWd

func (rpc *API) IsOurHeadInWd(repoOwner, repoName, path string) (bool, error)

func (*API) IsRepoConflicted

func (rpc *API) IsRepoConflicted(repoOwner, repoName string) (bool, error)

func (*API) ListAllRepoFiles

func (rpc *API) ListAllRepoFiles(repoOwner, repoName string) (git.DirectoryEntry, error)

ListAllRepoFiles lists all the repo files that are in the repo in a DirectoryEntry format.

func (*API) ListFiles

func (rpc *API) ListFiles(repoOwner, repoName, pathregex string) ([]string, error)

ListFiles returns a list of the files with the pathregex in the repo.

func (*API) ListPullRequests

func (rpc *API) ListPullRequests(repoOwner, repoName string) ([]*github.PullRequest, error)

func (*API) MergeFileOriginal

func (rpc *API) MergeFileOriginal(repoOwner, repoName, path string, version string) (bool, string, error)

MergeFileOriginal returns the original file for the merge-version from the named repo.

func (*API) MergedFileCat

func (rpc *API) MergedFileCat(repoOwner, repoName, path string) (bool, string, bool, string, error)

func (*API) MergedFileGit

func (rpc *API) MergedFileGit(repoOwner, repoName, path string) (bool, string, error)

MergedFileGit returns the git merged version of the file

func (*API) PrintPdfEndpoint

func (rpc *API) PrintPdfEndpoint(repoOwner, repoName, book, format, fileList string) (string, error)

func (*API) PullRequestDiffList

func (rpc *API) PullRequestDiffList(repoOwner, repoName string, prNumber int) ([]*git.PullRequestDiff, error)

func (*API) PullRequestUpdate

func (rpc *API) PullRequestUpdate(repoOwner, repoName, remoteSHA, filePath string, data string) error

func (*API) PullRequestVersions

func (rpc *API) PullRequestVersions(repoOwner, repoName, remoteUrl, remoteSha, filePath string) (string, string, error)

func (*API) RemoveFile

func (rpc *API) RemoveFile(repoOwner, repoName, path string) error

func (*API) RenameFile

func (rpc *API) RenameFile(repoOwner, repoName, fromPath, toPath string) error

func (*API) SaveMergingFile

func (rpc *API) SaveMergingFile(repoOwner, repoName string, path string, workingExists bool, workingContent string, theirExists bool, theirContent string) (string, error)

SaveMergingFile saves the 'Working' and 'Their' versions of the working file into our repo and our their-tree.

func (*API) SaveOurHeadToWd

func (rpc *API) SaveOurHeadToWd(repoOwner, repoName, path string) error

func (*API) SaveTheirHeadToWd

func (rpc *API) SaveTheirHeadToWd(repoOwner, repoName, path string) error

func (*API) SaveWorkingFile

func (rpc *API) SaveWorkingFile(repoOwner, repoName, path, content string) error

func (*API) SearchForFiles

func (rpc *API) SearchForFiles(repoOwner, repoName, fileRegex string) (string, []string, error)

func (*API) StageFile

func (rpc *API) StageFile(repoOwner, repoName, path string) error

func (*API) StageFileAndReturnMergingState

func (rpc *API) StageFileAndReturnMergingState(repoOwner, repoName, path string) (string, error)

func (*API) UpdateFile

func (rpc *API) UpdateFile(repoOwner, repoName, path, content string) error

func (*API) UpdateFileBinary

func (rpc *API) UpdateFileBinary(repoOwner, repoName, path string, contentB64 string) error

func (*API) Version

func (rpc *API) Version() string

====================== API METHODS FOLLOW ======================== Version returns the version of the API running on the server.

type Connection

type Connection struct {
	W      http.ResponseWriter
	R      *http.Request
	Client *git.Client
	User   string
}

func (*Connection) Context

func (c *Connection) Context(f func(*API) error) error

func (*Connection) GetContext

func (c *Connection) GetContext() context.Context

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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