git

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

README

Git Check

Ideas

  • Connect with private key

Testing

go test ./... -v --count=1 --cover

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Definition

type Definition struct {
	// IP or FQDN of the git server
	Host string `json:"host" optiontype:"required"`
	// TCP port number the git server is listening on
	Port uint16 `json:"port" default:"22"`
	// User to authenticate to the git repository
	Username string `json:"username"`
	// The users password
	Password string `json:"password"`
	// Token used for authentication
	Token string `json:"token"`
	// How to connect to the git server
	Protocol string `json:"protocol" default:"https"`
	// Repository path to append to the host
	Path string `json:"path" optiontype:"required"`
	// Target branch to checkout - conflicts with tag
	Branch string `json:"branch" default:"main"`
	// Target tag to checkout - conflicts with branch
	Tag string `json:"tag"`
	// Whether to skip verification of the server's TLS certificate
	TLSSkipVerify bool `json:"tlsSkipVerify" default:"false"`
	// File to retrieve from the git repository
	File string `json:"file"`
	// Whether the file must match a defined regex for the check to pass
	MatchContent bool `json:"matchContent" default:"false"`
	// Regex to match against the content of the returned file
	ContentRegex string `json:"contentRegex" default:".*"`
	// Whether or not to compare the head commit hash
	MatchHeadHash bool `json:"matchHeadHash" default:"false"`
	// The hash digest of the commit
	HeadHash string `json:"headHash"`
	// Whether or not to match a hash of the file contents
	MatchContentHash bool `json:"matchContentHash" default:"false"`
	// The sha3-256 hash digest of the files contents
	ContentHash string `json:"contentHash"`
	// Shared configuration across all checks
	checks.SharedDefinition
}

func (Definition) Run

func (d Definition) Run(ctx context.Context, static checks.StaticConf) (result checks.Results)

Run performs a git check

func (Definition) Validate

func (d Definition) Validate() (passed bool, message string)

Validate checks if the git definition is valid

Jump to

Keyboard shortcuts

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