package streaming
import "k8s.io/apimachinery/pkg/runtime/serializer/streaming"
Package streaming implements encoder and decoder for streams of runtime.Objects over io.Writer/Readers.
Index ¶
- Variables
- type Decoder
- type Encoder
- func NewEncoder(w io.Writer, e runtime.Encoder) Encoder
- func NewEncoderWithAllocator(w io.Writer, e runtime.EncoderWithAllocator, a runtime.MemoryAllocator) Encoder
- type Serializer
Variables ¶
Types ¶
type Decoder ¶
type Decoder interface { // Decode will return io.EOF when no more objects are available. Decode(defaults *schema.GroupVersionKind, into runtime.Object) (runtime.Object, *schema.GroupVersionKind, error) // Close closes the underlying stream. Close() error }
Decoder is a runtime.Decoder from a stream.
func NewDecoder ¶
func NewDecoder(r io.ReadCloser, d runtime.Decoder) Decoder
NewDecoder creates a streaming decoder that reads object chunks from r and decodes them with d. The reader is expected to return ErrShortRead if the provided buffer is not large enough to read an entire object.
type Encoder ¶
type Encoder interface { // Encode will write the provided object to the stream or return an error. It obeys the same // contract as runtime.VersionedEncoder. Encode(obj runtime.Object) error }
Encoder is a runtime.Encoder on a stream.
func NewEncoder ¶
NewEncoder returns a new streaming encoder.
func NewEncoderWithAllocator ¶
func NewEncoderWithAllocator(w io.Writer, e runtime.EncoderWithAllocator, a runtime.MemoryAllocator) Encoder
NewEncoderWithAllocator returns a new streaming encoder
type Serializer ¶
Serializer is a factory for creating encoders and decoders that work over streams.
Source Files ¶
streaming.go
- Version
- v0.26.4
- Published
- Feb 15, 2023
- Platform
- js/wasm
- Imports
- 5 packages
- Last checked
- 7 hours ago –
Tools for package owners.