podutil

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2017 License: Apache-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

podutil contains utilities for reading, writing and filtering streams and lists of api.Pod objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Annotate

func Annotate(meta *api.ObjectMeta, kv map[string]string)

Annotate safely copies annotation metadata from kv to meta.Annotations.

func Gunzip

func Gunzip(gzipped []byte) <-chan *api.Pod

func Gzip

func Gzip(pods <-chan *api.Pod) ([]byte, error)

func List

func List(pods <-chan *api.Pod) *api.PodList

List reads every pod from the pods chan and returns them all in an api.PodList

func ReadFromDir

func ReadFromDir(dirpath string) (<-chan *api.Pod, <-chan error)

func Stream

func Stream(list *api.PodList, err error) <-chan *api.Pod

Stream returns a chan of pods that yields each pod from the given list. No pods are yielded if err is non-nil.

func WriteToDir

func WriteToDir(pods <-chan *api.Pod, destDir string) error

Types

type FilterFunc

type FilterFunc func(pod *api.Pod) (bool, error)

return true if the pod passes the filter

func Annotator

func Annotator(m map[string]string) FilterFunc

Annotator returns a filter that copies annotations from map m into a pod

func Environment added in v0.4.0

func Environment(env []api.EnvVar) FilterFunc

Environment returns a filter that writes environment variables into pod containers

func (FilterFunc) Do

func (filter FilterFunc) Do(in <-chan *api.Pod) <-chan *api.Pod

type Filters

type Filters []FilterFunc

func (Filters) Do added in v0.4.0

func (filters Filters) Do(in <-chan *api.Pod) (out <-chan *api.Pod)

Jump to

Keyboard shortcuts

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