k8s

package
v0.0.0-...-a7d64e5 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stream

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

Stream is a stream that processes lists of Kubernetes objects. It assumes that the input contains the JSON representation of a list, locates the `items` field and then proceses the items in a streaming fashion, without first reading all the complete list of items in memory. Don't create instances of this type directly, use the NewStream function instead.

func (*Stream) Next

func (s *Stream) Next(ctx context.Context) (item data.Object, err error)

Next is the implementation of the stream interface.

type StreamBuilder

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

StreamBuilder contains the data and logic needed to create an stream that processes list of Kubernetes objects. Don't create instances of this type directly, use the NewStream function instead.

func NewStream

func NewStream() *StreamBuilder

NewStream creates a builder that can then be used to create and configure a stream that processes list of Kubernetes objects.

func (*StreamBuilder) Build

func (b *StreamBuilder) Build() (result *Stream, err error)

func (*StreamBuilder) SetLogger

func (b *StreamBuilder) SetLogger(value *slog.Logger) *StreamBuilder

SetLogger sets the logger that the stream will use to write to the log. This is mandatory.

func (*StreamBuilder) SetReader

func (b *StreamBuilder) SetReader(value io.Reader) *StreamBuilder

SetReader sets the input source. This is mandatory.

Note that the stream will automatically close this reader when it reaches the end of the stream, so refrain from closing it as it may result in prematurely ending the stream.

Jump to

Keyboard shortcuts

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