pods

package
v2.11.25 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: Apache-2.0, Apache-2.0 Imports: 13 Imported by: 0

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

Types

type Container

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

func (*Container) LogReader

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

func (*Container) Status

func (c *Container) Status(ctx context.Context) 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(ctx context.Context) (<-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(ctx context.Context) (*corev1.Pod, error)

Get gets the pod

func (*Pod) Stream

func (p *Pod) Stream(ctx context.Context, 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(ctx context.Context) (*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(ctx context.Context) (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