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"`
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
Click to show internal directories.
Click to hide internal directories.