gitmanager

package
v0.0.0-...-e163d20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env struct {
	Name    string
	LastTag string
	SemVer  helper.SemanticVersion
}

TODO: change name of Env

type GitRepository

type GitRepository struct {
	URL      string
	Branch   string
	Name     string
	Dir      string
	LastHash string
	LastTag  string
	Envs     map[string]Env
	Mux      sync.RWMutex
	// contains filtered or unexported fields
}

GitRepository represents a Git repository for managing configurations.

func NewGitRepository

func NewGitRepository(repoURL, branch string, envs []string) (*GitRepository, error)

NewGitRepository creates and initializes a new GitRepository instance.

func (*GitRepository) CloneRemoteRepo

func (gr *GitRepository) CloneRemoteRepo() error

CloneRemoteRepo clones the remote repository.

func (*GitRepository) FetchAndCheckout

func (gr *GitRepository) FetchAndCheckout(tag string) error

func (*GitRepository) PullTagsFromRemoteRepo

func (gr *GitRepository) PullTagsFromRemoteRepo() ([]string, error)

func (*GitRepository) PullUpdatesFromRemoteRepo

func (gr *GitRepository) PullUpdatesFromRemoteRepo() error

PullUpdatesFromRemoteRepo pulls updates from the remote repository.

func (*GitRepository) RemoveLocalRepo

func (gr *GitRepository) RemoveLocalRepo() error

RemoveLocalRepo removes the local repository directory.

func (*GitRepository) SetEnvLatestVersion

func (gr *GitRepository) SetEnvLatestVersion(_ context.Context, env string, lastTag string, lastSemVer helper.SemanticVersion) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL