Documentation
¶
Index ¶
Constants ¶
View Source
const NotFoundError = "not found"
Variables ¶
This section is empty.
Functions ¶
func DeleteAuthToken ¶
func DeleteAuthToken() error
func GetAuthToken ¶
func SaveAuthToken ¶
Types ¶
type ApiFetcher ¶
type ApiFetcher struct {
// contains filtered or unexported fields
}
func NewGitHubAPIFetcher ¶
func NewGitHubAPIFetcher(client *github.Client) *ApiFetcher
func (*ApiFetcher) Fetch ¶
func (f *ApiFetcher) Fetch(target GitHubTarget, path string) ([]byte, error)
type GitHubContentFetcher ¶
type GitHubContentFetcher interface {
Fetch(target GitHubTarget, path string) ([]byte, error)
}
type GitHubHandler ¶
type GitHubHandler struct {
// contains filtered or unexported fields
}
func NewGitHubHandler ¶
func NewGitHubHandler( fetcher GitHubContentFetcher, ) *GitHubHandler
func (*GitHubHandler) AddRootSite ¶
func (h *GitHubHandler) AddRootSite(target GitHubTarget) *GitHubHandler
func (*GitHubHandler) AddSite ¶
func (h *GitHubHandler) AddSite(route string, target GitHubTarget) *GitHubHandler
func (*GitHubHandler) ServeHTTP ¶
func (h *GitHubHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GitHubTarget ¶
type GitHubTarget struct {
// contains filtered or unexported fields
}
func InferTargetFromUrl ¶
func InferTargetFromUrl(githubUrl string) (GitHubTarget, error)
InferTargetFromUrl will take a valid GitHub URL and create a GitHubTarget object from it. A GitHub URL will take the form "https://github.com/{owner}/{repo}/(tree/<ref>)?/(<path>/<to>/<root>)?", where: - "tree/<ref>" is optional, if not present it defaults to the default branch of the repo - "<ref>" can either be a commit hash or branch - "<path>/<to>/<root>" is optional - If "<path>/<to>/<root>" is present, then "tree/<ref>" MUST be present
Click to show internal directories.
Click to hide internal directories.