-
Notifications
You must be signed in to change notification settings - Fork 7
/
github.go
22 lines (16 loc) · 882 Bytes
/
github.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package interfaces
import (
"github.com/google/go-github/v43/github"
cliGitHub "github.com/recode-sh/recode/github"
)
type GitHubManager interface {
GetAuthenticatedUser(accessToken string) (*cliGitHub.AuthenticatedUser, error)
CreateRepository(accessToken string, organization string, properties *github.Repository) (*github.Repository, error)
DoesRepositoryExist(accessToken, repositoryOwner, repositoryName string) (bool, error)
GetFileContentFromRepository(accessToken, repositoryOwner, repositoryName, filePath string) (string, error)
CreateSSHKey(accessToken string, keyPairName string, publicKeyContent string) (*github.Key, error)
RemoveSSHKey(accessToken string, sshKeyID int64) error
CreateGPGKey(accessToken string, publicKeyContent string) (*github.GPGKey, error)
RemoveGPGKey(accessToken string, gpgKeyID int64) error
IsNotFoundError(err error) bool
}