streamwriter

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResourceKind

type ResourceKind string

ResourceKind represents k8s resource name.

type ResponseStream

type ResponseStream interface {
	io.Writer
	http.Flusher
}

ResponseStream is an interface that allows Server Push to a Service.

type StreamWriter

type StreamWriter struct {
	sync.Mutex
	// contains filtered or unexported fields
}

StreamWriter operates a given stream to send a received WatchEvent to the frontend.

func NewStreamWriter

func NewStreamWriter(stream ResponseStream) *StreamWriter

func (*StreamWriter) Write

func (sw *StreamWriter) Write(we *WatchEvent) error

Write encodes the an received WatchEvent and push it to the frontend.

type WatchEvent

type WatchEvent struct {
	Kind      ResourceKind
	EventType watch.EventType
	// Obj is an object included in the event notified by the watched apiserver.
	Obj interface{}
}

WatchEvent represents an event notified by the watched apiserver.

Directories

Path Synopsis
Package mock_streamwriter is a generated GoMock package.
Package mock_streamwriter is a generated GoMock package.

Jump to

Keyboard shortcuts

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