Documentation
¶
Overview ¶
Package kamino makes it super easy to clone things from GitHub.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Logger *logrus.Logger
Logger is the logger used by the runner package. It is initialized in the init() function so it may be overwritten any time after that.
Functions ¶
func ValidateGenome ¶
ValidateGenome validates a genome and returns a non-nil error if the genome is invalid.
Types ¶
type CacheOption ¶
type CacheOption string
A CacheOption is one of the valid cache option constants.
const ( // Create - use cache if already created, create cache if not present. Create CacheOption = "create" // Force - use cache if already created, fail if cache not present. Force CacheOption = "force" // IfAvailable - use cache if already created, otherwise create a uniquely named directory. IfAvailable CacheOption = "if_available" // No - do not use cache, create a uniquely named directory. No CacheOption = "no" )
func (CacheOption) IsValid ¶
func (opt CacheOption) IsValid() bool
IsValid indicates whether or not the cache option is valid.
type CloneFactory ¶
type CloneFactory struct {
// contains filtered or unexported fields
}
A CloneFactory generates your clones for you. Create a clone factory with NewCloneFactory().
func NewCloneFactory ¶
func NewCloneFactory(workdir string) (*CloneFactory, error)
NewCloneFactory creates a new CloneFactory, ready to do some cloning for you (into its specified workdir).
type Genome ¶
type Genome struct {
APIToken string
Account string
Depth string
Ref string
Repo string
UseCache CacheOption
}
A Genome is the genetic options for a clone. Here are the requirements for a valid genome:
- Account
- purpose: GitHub account
- required: true
- Cache
- purpose: whether or not to use the cached / previously cloned version of the repo
- required: false
- default: No
- Depth
- purpose: git clone `--depth` option
- required: false
- default: "" (the whole repo will be cloned)
- validation: must be empty string or parsable as a base 10 integer
- Ref
- purpose: the git SHA to check out in the cloned repo
- required: true
- Repo
- purpose: GitHub repo
- required: true
- APIToken
- purpose: GitHub API token for private repos
- required: false (functionally required if your repo is private)
- default: (not sent with request if empty)
