policy

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BundleVersion    = 1 // Latest released MAJOR version for tunnel-checks
	BundleRepository = "mirror.gcr.io/khulnasoft/tunnel-checks"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements check operations

func NewClient

func NewClient(cacheDir string, quiet bool, checkBundleRepo string, opts ...Option) (*Client, error)

NewClient is the factory method for check client

func (*Client) Clear

func (c *Client) Clear() error

func (*Client) DownloadBuiltinChecks

func (c *Client) DownloadBuiltinChecks(ctx context.Context, registryOpts types.RegistryOptions) error

DownloadBuiltinChecks download default policies from GitHub Pages

func (*Client) GetMetadata

func (c *Client) GetMetadata(ctx context.Context) (*Metadata, error)

func (*Client) LoadBuiltinChecks

func (c *Client) LoadBuiltinChecks() ([]string, error)

LoadBuiltinChecks loads default policies

func (*Client) NeedsUpdate

func (c *Client) NeedsUpdate(ctx context.Context, registryOpts types.RegistryOptions) (bool, error)

NeedsUpdate returns if the default check should be updated

type Metadata

type Metadata struct {
	Digest       string
	DownloadedAt time.Time
}

Metadata holds default check metadata

func (Metadata) String

func (m Metadata) String() string

type Option

type Option func(*options)

Option is a functional option

func WithClock

func WithClock(c clock.Clock) Option

WithClock takes a clock

func WithOCIArtifact

func WithOCIArtifact(art *oci.Artifact) Option

WithOCIArtifact takes an OCI artifact

Jump to

Keyboard shortcuts

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