requirements

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package requirements collects a few implementations of the v1.Requirement interface. This is a simple strcut that helps decomposers express and check what they need to extract dependency data.

## Interface and Methods

The interface is really simple:

```golang

type Requirement interface {
	Description() string
	Check() bool
}

```

Any implementation needs to expose two methods:

### Description()

This function returns human readable text to expose to users in CLIs, etc

### Check()

Check returns a boolean that indicates if the requirement is met.

## Available Implementations

- Network is a requirements implementation that checks for network connectivity to a specific host.

- Executable looks for an executable in the system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executable

type Executable struct {
	Command string
}

func (*Executable) Check

func (er *Executable) Check(_ context.Context) bool

Check verifies the binaries can be run

func (*Executable) Description

func (er *Executable) Description() string

type Network

type Network struct {
	Host  string
	Port  int
	Proto string
}

Network is a requirements implementation that checks that the runtime is able to connect to a specific host and port.

func (*Network) Check

func (nr *Network) Check(ctx context.Context) bool

Check verifies the binaries can be run

func (*Network) Description

func (nr *Network) Description() string

Jump to

Keyboard shortcuts

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