client

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Apache-2.0 Imports: 5 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) IsExist

func (n Nodes) IsExist(name string) (*gojenkins.Node, bool)

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"`
}

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