subscribe

package
v0.0.0-...-52cadad Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Upgrader = websocket.Upgrader{
	HandshakeTimeout:  60 * time.Second,
	EnableCompression: true,
}

Functions

func DefaultGetter

func DefaultGetter(apiOp *types2.APIRequest) *types2.APISchemas

func Handler

func Handler(apiOp *types.APIRequest, getter SchemasGetter, serverVersion string) (types.APIObjectList, error)

func MarshallObject

func MarshallObject(apiOp *types.APIRequest, getter SchemasGetter, event types.APIEvent) types.APIEvent

func NewHandler

func NewHandler(getter SchemasGetter, serverVersion string) types.RequestListHandler

func Register

func Register(schemas *types2.APISchemas, getter SchemasGetter, serverVersion string)

Types

type Converter

type Converter struct {
	writer.EncodingResponseWriter
	// contains filtered or unexported fields
}

func (*Converter) Encoder

func (c *Converter) Encoder(_ io.Writer, obj interface{}) error

func (*Converter) ToAPIObject

func (c *Converter) ToAPIObject(data types.APIObject) (interface{}, error)

type SchemasGetter

type SchemasGetter func(apiOp *types2.APIRequest) *types2.APISchemas

type Subscribe

type Subscribe struct {
	Stop            bool   `json:"stop,omitempty"`
	ResourceType    string `json:"resourceType,omitempty"`
	ResourceVersion string `json:"resourceVersion,omitempty"`
	Namespace       string `json:"namespace,omitempty"`
	ID              string `json:"id,omitempty"`
	Selector        string `json:"selector,omitempty"`
}

type WatchSession

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

func NewWatchSession

func NewWatchSession(apiOp *types.APIRequest, getter SchemasGetter) *WatchSession

func (*WatchSession) Close

func (s *WatchSession) Close()

func (*WatchSession) Watch

func (s *WatchSession) Watch(conn *websocket.Conn) <-chan types.APIEvent

Jump to

Keyboard shortcuts

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