klone: github.com/kris-nova/klone/pkg/provider/github Index | Files

package github

import "github.com/kris-nova/klone/pkg/provider/github"


Package Files

github.go klone.go repo.go


const (
    AccessTokenNote = "Access token automatically managed my Klone. More information: https://github.com/kris-nova/klone."


var (
    Cache              = fmt.Sprintf("%s/.klone/auth", local.Home())
    RefreshCredentials = false
    Testing            = false

type GitHubCredentials Uses

type GitHubCredentials struct {
    User  string
    Pass  string
    Token string

GitHubCredentials are how we log into GitHub.com

type GitServer Uses

type GitServer struct {
    // contains filtered or unexported fields

GitServer is a representation of GitHub.com, by design we never store credentials here in memory Todo (@kris-nova) encrypt these creds please!

func (*GitServer) Authenticate Uses

func (s *GitServer) Authenticate() error

Authenticate will parse configuration with the following hierarchy. 1. Access token from local cache 2. Access token from env var 3. Username/Password from env var Authenticate will then attempt to log in (prompting for MFA if necessary) Authenticate will then attempt to ensure a unique access token created by klone for future access To ensure a new auth token, simply set the env var and klone will re-cache the new token

func (*GitServer) DeleteRepo Uses

func (s *GitServer) DeleteRepo(name string) (bool, error)

func (*GitServer) DeleteRepoByOwner Uses

func (s *GitServer) DeleteRepoByOwner(name, owner string) (bool, error)

func (*GitServer) Fork Uses

func (s *GitServer) Fork(parent provider.Repo, newOwner string) (provider.Repo, error)

func (*GitServer) GetRepo Uses

func (s *GitServer) GetRepo(name string) (provider.Repo, error)

GetRepo is the most effecient way to look up a repository exactly by it's name and assumed owner (you)

func (*GitServer) GetRepoByOwner Uses

func (s *GitServer) GetRepoByOwner(owner, name string) (provider.Repo, error)

GetRepoByOwner is the most effecient way to look up a repository exactly by it's name and owner

func (*GitServer) GetRepos Uses

func (s *GitServer) GetRepos() (map[string]provider.Repo, error)

GetRepos will return (and cache) a hash map of repositories by name for some convenient O(n*log(n)) look up!

func (*GitServer) GetServerString Uses

func (s *GitServer) GetServerString() string

GetServerString returns a server string is the string we would want to use in things like $GOPATH In this case we know we are dealing with GitHub.com so we can safely return it.

func (*GitServer) NewRepo Uses

func (s *GitServer) NewRepo(name, desc string) (provider.Repo, error)

func (*GitServer) OwnerEmail Uses

func (s *GitServer) OwnerEmail() string

func (*GitServer) OwnerName Uses

func (s *GitServer) OwnerName() string

type KloneProvider Uses

type KloneProvider struct {

func (*KloneProvider) NewGitServer Uses

func (k *KloneProvider) NewGitServer() (provider.GitServer, error)

type Repo Uses

type Repo struct {
    // contains filtered or unexported fields

func (*Repo) Description Uses

func (r *Repo) Description() string

func (*Repo) ForkedFrom Uses

func (r *Repo) ForkedFrom() provider.Repo

func (*Repo) GetKlonefile Uses

func (r *Repo) GetKlonefile() []byte

func (*Repo) GitCloneUrl Uses

func (r *Repo) GitCloneUrl() string

func (*Repo) GitRemoteUrl Uses

func (r *Repo) GitRemoteUrl() string

func (*Repo) HttpsCloneUrl Uses

func (r *Repo) HttpsCloneUrl() string

func (*Repo) Language Uses

func (r *Repo) Language() string

func (*Repo) Name Uses

func (r *Repo) Name() string

func (*Repo) Owner Uses

func (r *Repo) Owner() string

func (*Repo) SetImplementation Uses

func (r *Repo) SetImplementation(impl interface{})

Package github imports 11 packages (graph) and is imported by 1 packages. Updated 2017-08-12. Refresh now. Tools for package owners.