pods

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStream

func NewStream(pods typedv1.PodInterface, name string, opts *corev1.PodLogOptions) stream.Streamer

func ParsePodTemplate added in v0.12.0

func ParsePodTemplate(httpClient http.Client, podTemplateLocation string, validate file.TypeValidator, errorMsg error) (pod.PodTemplate, error)

Types

type Container

type Container struct {
	NewStreamer stream.NewStreamerFunc
	// contains filtered or unexported fields
}

func (*Container) LogReader

func (c *Container) LogReader(follow, timestamps bool) *LogReader

func (*Container) Status

func (c *Container) Status() error

type Log

type Log struct {
	PodName       string
	ContainerName string
	Log           string
}

Log represents one log message from a pod

type LogReader

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

func (*LogReader) Read

func (lr *LogReader) Read() (<-chan Log, <-chan error, error)

type Pod

type Pod struct {
	Name     string
	Ns       string
	Kc       k8s.Interface
	Streamer stream.NewStreamerFunc
}

func New

func New(name, ns string, client k8s.Interface, streamer stream.NewStreamerFunc) *Pod

func NewWithDefaults

func NewWithDefaults(name, ns string, client k8s.Interface) *Pod

func (*Pod) Container

func (p *Pod) Container(c string) *Container

Container returns the an instance of Container

func (*Pod) Get

func (p *Pod) Get() (*corev1.Pod, error)

Get gets the pod

func (*Pod) Stream

func (p *Pod) Stream(opt *corev1.PodLogOptions) (io.ReadCloser, error)

Stream returns the stream object for given container and mode in order to fetch the logs

func (*Pod) Wait

func (p *Pod) Wait() (*corev1.Pod, error)

Wait wait for the pod to get up and running

type Stream

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

func (*Stream) Stream

func (s *Stream) Stream() (io.ReadCloser, error)

Stream Creates a stream object which allows reading the logs

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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