Documentation ¶
Index ¶
- func CreateGitHubClient(token string) *scm.Client
- type Cache
- type LocalCache
- func (l *LocalCache) CommitAndPushBranch(ctx context.Context, repoURL, branch, message, token string) error
- func (l *LocalCache) CreateAndCheckoutBranch(ctx context.Context, repoURL, fromBranch, newBranch string) error
- func (l *LocalCache) ReadFileFromBranch(ctx context.Context, repoURL, filePath, branch string) ([]byte, error)
- func (l *LocalCache) WriteFileToBranchAndStage(ctx context.Context, repoURL, branch, filePath string, data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateGitHubClient ¶
CreateGitHubClient creates and returns a go-scm GitHub client, using the provided oauth2 token.
Types ¶
type Cache ¶
type Cache interface { ReadFileFromBranch(ctx context.Context, repoURL, filePath, branch string) ([]byte, error) CreateAndCheckoutBranch(ctx context.Context, repoURL, fromBranch, newBranch string) error WriteFileToBranchAndStage(ctx context.Context, repoURL, branch, filePath string, data []byte) error CommitAndPushBranch(ctx context.Context, repoURL, branch, message, token string) error }
type LocalCache ¶
type LocalCache struct {
// contains filtered or unexported fields
}
func NewLocalCache ¶
func NewLocalCache(cacheDir, name, email string) (*LocalCache, error)
NewLocalCache creates a new LocalCache and ensures that the provided cacheDir exists.
func (*LocalCache) CommitAndPushBranch ¶
func (l *LocalCache) CommitAndPushBranch(ctx context.Context, repoURL, branch, message, token string) error
func (*LocalCache) CreateAndCheckoutBranch ¶
func (l *LocalCache) CreateAndCheckoutBranch(ctx context.Context, repoURL, fromBranch, newBranch string) error
func (*LocalCache) ReadFileFromBranch ¶
func (*LocalCache) WriteFileToBranchAndStage ¶
Click to show internal directories.
Click to hide internal directories.