client

package
v0.0.0-...-1a21f29 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrJobRunning = errors.Sentinel("job running")
	ErrJobUpdated = errors.Sentinel("job updated")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func (*Client) CreateJob

func (c *Client) CreateJob(job *jw.Job) (*jw.Job, error)

func (*Client) CreateWorkflow

func (c *Client) CreateWorkflow(wf *jw.Workflow) (*jw.Workflow, error)

func (*Client) NextJob

func (c *Client) NextJob(namespace string) (*jw.Job, error)

func (*Client) UpdateJob

func (c *Client) UpdateJob(job *jw.Job) (*jw.Job, error)

type Config

type Config struct {
	Endpoints []*Endpoint `cfg:"endpoints"`
	CertFile  string      `cfg:"cert_file"`
	KeyFile   string      `cfg:"key_file"`
	Logger    Logger
}

func (*Config) BuildClient

func (c *Config) BuildClient() (*Client, error)

type ConfigOption

type ConfigOption func(*Config)

func WithCertKeyFiles

func WithCertKeyFiles(certFile, keyFile string) ConfigOption

func WithEndpoint

func WithEndpoint(ep *Endpoint) ConfigOption

func WithLogger

func WithLogger(logger Logger) ConfigOption

type Endpoint

type Endpoint struct {
	URL      string `cfg:"url"`
	Username string `cfg:"username"`
	Password string `cfg:"password"`
	CAFile   string `cfg:"ca_file"`
}

func NewEndpoint

func NewEndpoint(url, username, password string, options ...EndpointOption) *Endpoint

type EndpointOption

type EndpointOption func(*Endpoint)

func WithCAFile

func WithCAFile(filename string) EndpointOption

type Logger

type Logger interface {
	Trace(msg string, kv ...interface{})
	Debug(msg string, kv ...interface{})
	Notice(msg string, kv ...interface{})
	Warning(msg string, kv ...interface{})
	Error(msg string, kv ...interface{})
}

Jump to

Keyboard shortcuts

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