Documentation ¶
Index ¶
- Constants
- Variables
- func GetProfilesPath(clusterName, profilesManifestPath string) string
- func GetSystemPath(clusterName string) string
- type Author
- type Commit
- type Git
- type GoGit
- func (g *GoGit) Checkout(newBranch string) error
- func (g *GoGit) Clone(ctx context.Context, path, url, branch string) (bool, error)
- func (g *GoGit) Commit(message Commit, filters ...func(string) bool) (string, error)
- func (g *GoGit) GetRemoteUrl(dir string, remoteName string) (string, error)
- func (g *GoGit) Head() (string, error)
- func (g *GoGit) Init(path, url, branch string) (bool, error)
- func (g *GoGit) Open(path string) (*gogit.Repository, error)
- func (g *GoGit) Push(ctx context.Context) error
- func (g *GoGit) Read(path string) ([]byte, error)
- func (g *GoGit) Remove(path string) error
- func (g *GoGit) Status() (bool, error)
- func (g *GoGit) ValidateAccess(ctx context.Context, url string, branch string) error
- func (g *GoGit) Write(path string, content []byte) error
Constants ¶
const WegoAppDir = "apps"
WegoAppDir is where applications information will live in the GitOps repo
const WegoClusterDir = "clusters"
WegoClusterDir is where cluster information and manifests will live in the GitOps repo
const WegoClusterOSWorkloadDir = "system"
WegoClusterOSWorkloadDir is where OS workload manifests will live in the GitOps repo
const WegoClusterUserWorkloadDir = "user"
WegoClusterUserWorkloadDir is where user workload manifests will live in the GitOps repo
const WegoRoot = ".weave-gitops"
WegoRoot is the default root directory for the GitOps repo
Variables ¶
var ( ErrNoGitRepository = errors.New("no git repository") ErrNoStagedFiles = errors.New("no staged files") )
Functions ¶
func GetProfilesPath ¶ added in v0.7.0
GetProfilesPath returns the path of the file containing the manifests of installed Profiles joined with the cluster's system directory
func GetSystemPath ¶ added in v0.6.1
Types ¶
type Git ¶
type Git interface { Open(path string) (*gogit.Repository, error) Init(path, url, branch string) (bool, error) Clone(ctx context.Context, path, url, branch string) (bool, error) Checkout(newBranch string) error Read(path string) ([]byte, error) Write(path string, content []byte) error Remove(path string) error Commit(message Commit, filters ...func(string) bool) (string, error) Push(ctx context.Context) error Status() (bool, error) Head() (string, error) GetRemoteUrl(dir string, remoteName string) (string, error) ValidateAccess(ctx context.Context, url string, branch string) error }
Git is an interface for basic Git operations on a single branch of a remote repository.
type GoGit ¶
type GoGit struct {
// contains filtered or unexported fields
}
func (*GoGit) Clone ¶
Clone clones a starting repository URL to a path, and checks out the provided branch name.
If the directory is successfully initialised, it returns true, otherwise it returns false.
func (*GoGit) GetRemoteUrl ¶ added in v0.2.3
GetRemoteUrl returns the url of the first listed remote server
func (*GoGit) Init ¶
Init initialises the directory at path with the remote and branch provided.
If the directory is successfully initialised it returns true, otherwise if the directory is already initialised, it returns false.
func (*GoGit) Open ¶
func (g *GoGit) Open(path string) (*gogit.Repository, error)
Open opens a git repository in the provided path, and returns a repository.
func (*GoGit) ValidateAccess ¶ added in v0.2.3
Directories ¶
Path | Synopsis |
---|---|
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
wrapperfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |