action

package
v0.0.0-...-27a0594 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAPIKeyRequired      = errors.New("auth token is required")
	ErrProjectNameRequired = errors.New("project name is required")
	ErrAPIUrlRequired      = errors.New("api url is required")
)

Functions

func Log

func Log(msg string, a ...interface{})

Log will write a log entry to stdout.

func LogDebug

func LogDebug(msg string, a ...interface{})

LogDebug will write a debug message command to stdout.

func LogError

func LogError(msg string, a ...interface{})

LogError will write a error message command to stdout.

func LogErrorAndExit

func LogErrorAndExit(msg string, a ...interface{})

LogErrorAndExit will write a error message command to stdout and exit with a non-zero exit code.

func LogWarning

func LogWarning(msg string, a ...interface{})

LogWarning will write a warning message command to stdout.

Types

type Input

type Input struct {
	APIKey   string `env:"INPUT_METAL_AUTH_TOKEN"`
	Projects string `env:"INPUT_PROJECT_NAMES"`
	DryRun   bool   `env:"INPUT_DRY_RUN"`
}

Input represents the input parameters.

func NewInput

func NewInput() (*Input, error)

NewInput creates a new input from the environment variables.

type MetalJanitorAction

type MetalJanitorAction interface {
	// Cleanup is used to cleanup the Equinix Metal projects.
	Cleanup(projectNames string, dryRun bool) error
}

MetalJanitorAction represents the interface for the cleanup action.

func New

func New(authToken string, httpClient *http.Client) (MetalJanitorAction, error)

New will create a new instance of the metal janitor action.

func NewWithURL

func NewWithURL(authToken string, httpClient *http.Client, apiURL string) (MetalJanitorAction, error)

NewWithURL will create a new instance of the metal janitor action using a specific URL for the Equinix api.

Jump to

Keyboard shortcuts

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