gitops

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package gitops provides a simplified interface for Git operations, specifically for monitoring and Updating repositories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service manages the Git repository lifecycle and version detection. It wraps the go-git library to provide high-level operations.

func NewService

func NewService(cfg *config.Config) *Service

NewService initializes a new Service with the provided config.Config.

func (*Service) CheckForUpdates

func (s *Service) CheckForUpdates() (bool, string, error)

CheckForUpdates fetches the latest references from the remote (origin) and compares the local HEAD with the remote target branch (master/main). It returns true and the new hash if an update is detected.

func (*Service) EnsureClone

func (s *Service) EnsureClone() error

EnsureClone checks if the repository exists locally at the configured path and performs a clone if it is missing.

func (*Service) UpdateLocal

func (s *Service) UpdateLocal() error

UpdateLocal performs a pull operation to synchronize the local repository with the latest changes from the remote tracking branch.

Jump to

Keyboard shortcuts

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