package git
import "github.com/oslokommune/okctl/pkg/git"
Package git knows how to do git operations
Index ¶
- func RepositoryURL(org, repo string) string
- type ActionFn
- func AddFile(workingDir, fileName string, content []byte) ActionFn
- func RemoveFile(workingDir, fileName string) ActionFn
- type ChangeSet
- type Git
- type RemoteFileDeleter
- type RepositoryStagerFn
- func RepositoryStagerClone(repoURL string) RepositoryStagerFn
- func RepositoryStagerInit(msg, fileName, content string, mem *memory.Storage) RepositoryStagerFn
- type Result
Functions ¶
func RepositoryURL ¶
RepositoryURL builds url based on org and repo
Types ¶
type ActionFn ¶
type ActionFn func(worktree *git.Worktree) error
ActionFn represents a function that makes changes
func AddFile ¶
AddFile is a helper action for adding a file to a repository
func RemoveFile ¶
RemoveFile is a helper action for removing a file from a repository
type ChangeSet ¶
type ChangeSet struct { Stager RepositoryStagerFn Branch string PushToRemote bool FileSystem billy.Filesystem CommitMessage string Actions []ActionFn }
ChangeSet contains the required inputs for updating a git repository
type Git ¶
type Git struct{}
Git contains the state required for working with a git repository
func New ¶
func New() *Git
New initializes a new Git
func (*Git) UpdateRepository ¶
UpdateRepository applies the change set
type RemoteFileDeleter ¶
type RemoteFileDeleter struct{}
RemoteFileDeleter knows how to delete a file in a remote Git repository
func (RemoteFileDeleter) Delete ¶
func (RemoteFileDeleter) Delete(repositoryURL string, path string, commitMessage string) error
Delete deletes a file from a remote Git repository
type RepositoryStagerFn ¶
type RepositoryStagerFn func(fs billy.Filesystem) (*git.Repository, error)
RepositoryStagerFn defines the required function for staging a git repository
func RepositoryStagerClone ¶
func RepositoryStagerClone(repoURL string) RepositoryStagerFn
RepositoryStagerClone knows how to clone a git repository from a given URL
func RepositoryStagerInit ¶
func RepositoryStagerInit(msg, fileName, content string, mem *memory.Storage) RepositoryStagerFn
RepositoryStagerInit initialises an empty repository
type Result ¶
Result contains data about the created content
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
pkg/git/nameserver | Package nameserver knows how to create git commits for zone delegation and revocation |
- Version
- v0.0.106 (latest)
- Published
- Oct 21, 2022
- Platform
- linux/amd64
- Imports
- 12 packages
- Last checked
- 18 hours ago –
Tools for package owners.