targetlist

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package targetlist implements a simple target manager that contains a static list of targets. Use it as follows in a job descriptor: "TargetManager": "targetlist",

"TargetManagerAcquireParameters": {
    "Targets": [
        {
            "Name": "hostname1.example.com",
            "ID": "id1"
        },
        {
            "Name": "hostname2.example.com",
            "ID": "id2"
        }

] }

hostname1.example.com,1.2.3.4 hostname2,2001:db8::1

In other words, two fields: the first containing a host name (fully qualified or not), and the second containin the IP address of the target (this field is optional).

Index

Constants

This section is empty.

Variables

View Source
var (
	Name = "TargetList"
)

Name defined the name of the plugin

Functions

func Load

Load returns the name and factory which are needed to register the TargetManager.

func New

func New() target.TargetManager

New builds a new TargetList object.

Types

type AcquireParameters

type AcquireParameters struct {
	Targets []*target.Target
}

AcquireParameters contains the parameters necessary to acquire targets.

type ReleaseParameters

type ReleaseParameters struct {
}

ReleaseParameters contains the parameters necessary to release targets.

type TargetList

type TargetList struct {
}

TargetList implements the contest.TargetManager interface.

func (*TargetList) Acquire

func (t *TargetList) Acquire(ctx xcontext.Context, jobID types.JobID, jobTargetManagerAcquireTimeout time.Duration, parameters interface{}, tl target.Locker) ([]*target.Target, error)

Acquire implements contest.TargetManager.Acquire

func (*TargetList) Release

func (t *TargetList) Release(ctx xcontext.Context, jobID types.JobID, targets []*target.Target, params interface{}) error

Release releases the acquired resources.

func (TargetList) ValidateAcquireParameters

func (t TargetList) ValidateAcquireParameters(params []byte) (interface{}, error)

ValidateAcquireParameters valides parameters that will be passed to Acquire.

func (TargetList) ValidateReleaseParameters

func (t TargetList) ValidateReleaseParameters(params []byte) (interface{}, error)

ValidateReleaseParameters valides parameters that will be passed to Release.

Jump to

Keyboard shortcuts

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