client

package
v0.0.0-...-683a7b2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigPrefix = "client"

ConfigPrefix define configuration prefix

Functions

This section is empty.

Types

type Client

type Client interface {
	Options() *Options

	Listable
	Watchable
}

Client represents the client interface

func New

func New(opts ...Option) (Client, error)

New creates a new client instance

type Listable

type Listable interface {
	Nodes() (*corev1.NodeList, error)
	Namespaces() (*corev1.NamespaceList, error)
	Deployments(ns string) (*appsv1.DeploymentList, error)
	Jobs(ns string) (*batchv1.JobList, error)
	Pods(ns string) (*corev1.PodList, error)
}

Listable represents a listable client interface

type Option

type Option func(*Options)

Option func

func Logger

func Logger(v logger.Logger) Option

Logger option

func TimeoutSeconds

func TimeoutSeconds(v int64) Option

TimeoutSeconds option

type Options

type Options struct {
	Logger logger.Logger `ignored:"true" json:"-"`

	InCluster  bool      `default:"true" envconfig:"in_cluster"`
	ConfigPath path.Path `envconfig:"config_path"`

	TimeoutSeconds int64 `default:"2" envconfig:"timeout_seconds"`
}

Options represents the list of options

type Watchable

type Watchable interface {
	NodesWatch() (watch.Interface, error)
	NamespacesWatch() (watch.Interface, error)
	DeploymentsWatch(ns string) (watch.Interface, error)
	JobsWatch(ns string) (watch.Interface, error)
	PodsWatch(ns string) (watch.Interface, error)
}

Watchable represents a watchable client interface

Jump to

Keyboard shortcuts

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