validation

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RetryLogFunc

func RetryLogFunc(showErrors bool) func(err error)

RetryLogFunc returns a retry log function depending on the given showErrors parameter. If it is set to true, exact errors are shown when retrying to connect to the git information service. Otherwise they are not shown.

Types

type ConfigValidator added in v1.3.1

type ConfigValidator struct {
	Config apps.Config
}

ConfigValidator validates a Config

func (ConfigValidator) Validate added in v1.3.1

func (c ConfigValidator) Validate() error

Validate validates the config

type GitInformationClient

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

func NewGitInformationClient

func NewGitInformationClient(address string, token string) (*GitInformationClient, error)

NewGitInformationClient returns a client which can be used to retrieve metadata information about a given git repository

func (*GitInformationClient) RepositoryInformation

func (g *GitInformationClient) RepositoryInformation(ctx context.Context, git apps.GitTarget, auth util.GitAuth) (*apps.GitExploreResponse, error)

RepositoryInformation returns information about a given git repository and optionally checks if a given revision can be found in the repo. It retries on client connection issues.

func (*GitInformationClient) SetLogRetryFunc

func (g *GitInformationClient) SetLogRetryFunc(f func(err error))

SetLogRetryFunc allows to set the function which logs retries when doing requests to the git information service

func (*GitInformationClient) SetRetryBackoffs

func (g *GitInformationClient) SetRetryBackoffs(backoff wait.Backoff)

SetRetryBackoffs sets the backoff properties for retries

type RepositoryValidator

type RepositoryValidator struct {
	GitInformationServiceURL string
	Token                    string
	Debug                    bool
}

RepositoryValidator validates a git repository

func (*RepositoryValidator) Validate

func (v *RepositoryValidator) Validate(ctx context.Context, git *apps.GitTarget, auth util.GitAuth) error

Validate validates the repository access and shows a visual spinner while doing so

Jump to

Keyboard shortcuts

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