requirements

package
v0.1.0-pre2 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

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() 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() 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