github

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

README

deploystack/github

This package contains code for communicating between github and DeployStack. This code is used primarily for tooling - getting repos so that other tools can download and look at code. It is also used by the main tool for pulling down content directly instead of relying on Open in Cloud Shell.

Documentation

Overview

Package github includes all of the client calls to github for building automation tools for deploystack

Index

Constants

View Source
const GITHUBHOST = "github.com"

GITHUBHOST is the hostname of where to find github on the web

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Repo)

Option defines option functions that can be passed in to modify repos on New

func Branch

func Branch(b string) Option

Branch sets the branch on a repo

func Owner

func Owner(o string) Option

Owner sets the owner on a repo

func SiteURL

func SiteURL(u string) Option

SiteURL sets the owner, name, and branch of a repo based on a URL

type Repo

type Repo struct {
	Name        string `json:"name" yaml:"name"`
	Owner       string `json:"owner" yaml:"owner"`
	Branch      string `json:"branch" yaml:"branch"`
	Description string `json:"description" yaml:"description"`
}

Repo contains the details of a github repo for the purpose of downloading

func New

func New(name string, options ...Option) Repo

New generates Github from a series of options

func NewRepo deprecated

func NewRepo(repo string) Repo

NewRepo generates Github from a url that might contain branch information

Deprecated: Use New() Instead

func (Repo) Clone

func (r Repo) Clone(path string) error

Clone performs a git clone to the directory of our choosing

func (Repo) Path

func (r Repo) Path(path string) string

Path returns where this repo should exist locally given the input path

func (*Repo) Populate

func (r *Repo) Populate() error

Populate gets metadata from github

func (Repo) ReferenceName

func (r Repo) ReferenceName() string

ReferenceName is a shortcut to the reference for the current branch

func (Repo) URL

func (r Repo) URL() string

URL returns the github url of this repo

Jump to

Keyboard shortcuts

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