Documentation ¶
Index ¶
- Constants
- Variables
- type GitHubCredentials
- type GitServer
- func (s *GitServer) Authenticate() error
- func (s *GitServer) DeleteRepo(name string) (bool, error)
- func (s *GitServer) DeleteRepoByOwner(name, owner string) (bool, error)
- func (s *GitServer) Fork(parent provider.Repo, newOwner string) (provider.Repo, error)
- func (s *GitServer) GetRepo(name string) (provider.Repo, error)
- func (s *GitServer) GetRepoByOwner(owner, name string) (provider.Repo, error)
- func (s *GitServer) GetRepos() (map[string]provider.Repo, error)
- func (s *GitServer) GetServerString() string
- func (s *GitServer) NewRepo(name, desc string) (provider.Repo, error)
- func (s *GitServer) OwnerEmail() string
- func (s *GitServer) OwnerName() string
- type KloneProvider
- type Repo
- func (r *Repo) Description() string
- func (r *Repo) ForkedFrom() provider.Repo
- func (r *Repo) GetKlonefile() []byte
- func (r *Repo) GitCloneUrl() string
- func (r *Repo) GitRemoteUrl() string
- func (r *Repo) HttpsCloneUrl() string
- func (r *Repo) Language() string
- func (r *Repo) Name() string
- func (r *Repo) Owner() string
- func (r *Repo) SetImplementation(impl interface{})
Constants ¶
const (
AccessTokenNote = "Access token automatically managed my Klone. More information: https://github.com/kris-nova/klone."
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type GitHubCredentials ¶
GitHubCredentials are how we log into GitHub.com
type GitServer ¶
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 ¶
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) DeleteRepoByOwner ¶
func (*GitServer) GetRepo ¶
GetRepo is the most effecient way to look up a repository exactly by it's name and assumed owner (you)
func (*GitServer) GetRepoByOwner ¶
GetRepoByOwner is the most effecient way to look up a repository exactly by it's name and owner
func (*GitServer) GetRepos ¶
GetRepos will return (and cache) a hash map of repositories by name for some convenient O(n*log(n)) look up!
func (*GitServer) GetServerString ¶
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) OwnerEmail ¶
type KloneProvider ¶
type KloneProvider struct { }
func (*KloneProvider) NewGitServer ¶
func (k *KloneProvider) NewGitServer() (provider.GitServer, error)
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
func (*Repo) Description ¶
func (*Repo) ForkedFrom ¶
func (*Repo) GetKlonefile ¶
func (*Repo) GitCloneUrl ¶
func (*Repo) GitRemoteUrl ¶
func (*Repo) HttpsCloneUrl ¶
func (*Repo) SetImplementation ¶
func (r *Repo) SetImplementation(impl interface{})