client

package
v0.2.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JenkinsAccessor

type JenkinsAccessor interface {
	GetCurrentUsage(ctx context.Context) (int64, error)
	DeleteNode(ctx context.Context, name string) (bool, error)
	GetAllNodes(ctx context.Context) (Nodes, error)
	GetNode(ctx context.Context, name string) (*gojenkins.Node, error)
}

type Nodes

type Nodes map[string]*gojenkins.Node

func (Nodes) ExcludeNode

func (n Nodes) ExcludeNode(name string) Nodes

func (Nodes) ExcludeOffline

func (n Nodes) ExcludeOffline() Nodes

func (Nodes) Len

func (n Nodes) Len() int64

type Options

type Options struct {
	JenkinsURL          string          `config:"jenkins_url" validate:"required"`
	JenkinsUser         string          `config:"jenkins_user" validate:"required"`
	JenkinsToken        string          `config:"jenkins_token" validate:"required"`
	ControllerNodeName  string          `config:"controller_node_name"`
	NodeNumExecutors    int64           `config:"node_num_executors"`
	ExcludeNodesByLabel fs.CommaSepList `config:"exclude_nodes_by_label"`
	LastErrBackoff      time.Duration   `config:"last_err_backoff"`
}

func (*Options) Name

func (o *Options) Name() string

type WrapperClient

type WrapperClient struct {
	*gojenkins.Jenkins
	// contains filtered or unexported fields
}

func New

func New(opt *Options) *WrapperClient

New returns a new Client.

func (*WrapperClient) GetAllNodes

func (c *WrapperClient) GetAllNodes(ctx context.Context) (Nodes, error)

func (*WrapperClient) GetCurrentUsage

func (c *WrapperClient) GetCurrentUsage(ctx context.Context) (int64, error)

GetCurrentUsage return the current usage of jenkins nodes.

Jump to

Keyboard shortcuts

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