v1

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGRPCStream

func NewGRPCStream(in *Stream) *streamv1grpc.Stream

NewGRPCStream 基于 *Stream 创建 *streamv1grpc.Stream

func NewGRPCStreamList

func NewGRPCStreamList(in *StreamList) *streamv1grpc.StreamList

NewGRPCStreamList 基于 *StreamList 创建 *streamv1grpc.StreamList

Types

type Stream

type Stream struct {
	metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

	Spec   StreamSpec   `json:"spec,omitempty" yaml:"spec,omitempty"`
	Status StreamStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

Stream 流

func NewStreamFromGRPC

func NewStreamFromGRPC(in *streamv1grpc.Stream) *Stream

NewStreamFromGRPC 基于 *streamv1grpc.Stream 创建 *Stream

type StreamList

type StreamList struct {
	metav1.ListMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

	Items []Stream `json:"items,omitempty" yaml:"items,omitempty"`
}

StreamList 流列表

func NewStreamListFromGRPC

func NewStreamListFromGRPC(in *streamv1grpc.StreamList) *StreamList

NewStreamListFromGRPC 基于 *streamv1grpc.StreamList 创建 *StreamList

type StreamSpec

type StreamSpec struct {
	// 停止策略
	StopPolicy StreamStopPolicy `json:"stopPolicy,omitempty" yaml:"stopPolicy,omitempty"`
}

StreamSpec 流定义

type StreamStatus

type StreamStatus struct {
	// 用于加入流的 token
	Token string `json:"token,omitempty" yaml:"token,omitempty"`
}

StreamStatus 流状态

type StreamStopPolicy

type StreamStopPolicy string

StreamStopPolicy 流停止策略

const (
	// OnFirstConnectionLeft 第一次连接断开时停止
	OnFirstConnectionLeft StreamStopPolicy = "OnFirstConnectionLeft"
	// OnBothConnectionsLeft 两个连接都断开时停止
	OnBothConnectionsLeft StreamStopPolicy = "OnBothConnectionsLeft"
	// OnDelete 流被删除时停止
	OnDelete StreamStopPolicy = "OnDelete"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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