Documentation
¶
Index ¶
- Constants
- func NewPlugin(p StreamAPIExtension, opts ...StreamApiExtensionPluginOption) plugin.Plugin
- type Aggregator
- type Server
- type StreamAPIExtension
- type StreamApiExtensionPluginOption
- type StreamApiExtensionPluginOptions
- type StreamClientDisconnectHandler
- type StreamClientHandler
- type StreamDelegate
- type StreamMetricsConfig
Constants ¶
View Source
const ( StreamAPIExtensionPluginID = "opni.apiextensions.StreamAPIExtension" ServiceID = "apiextensions.StreamAPIExtension" )
Variables ¶
This section is empty.
Functions ¶
func NewPlugin ¶
func NewPlugin(p StreamAPIExtension, opts ...StreamApiExtensionPluginOption) plugin.Plugin
Types ¶
type Aggregator ¶ added in v0.8.2
type Aggregator func(reply any, msg *streamv1.BroadcastReplyList) error
Aggregator allows the user to aggregate the responses from a broadcast request, and store the result in reply.
var EmptyNothingAggregator Aggregator = func(any, *streamv1.BroadcastReplyList) error { return nil }
EmptyNothingAggregator is an aggregator to use if you don't need to do any aggregation, or don't care about the response.
type Server ¶
type Server struct { Desc *grpc.ServiceDesc Impl interface{} RequireCapability string }
type StreamAPIExtension ¶
type StreamAPIExtension interface {
StreamServers() []Server
}
type StreamApiExtensionPluginOption ¶ added in v0.9.1
type StreamApiExtensionPluginOption func(*StreamApiExtensionPluginOptions)
func WithMetrics ¶ added in v0.9.1
func WithMetrics(conf StreamMetricsConfig) StreamApiExtensionPluginOption
type StreamApiExtensionPluginOptions ¶ added in v0.9.1
type StreamApiExtensionPluginOptions struct {
// contains filtered or unexported fields
}
type StreamClientDisconnectHandler ¶ added in v0.6.1
type StreamClientDisconnectHandler interface {
StreamDisconnected()
}
A plugin can optionally implement StreamClientDisconnectHandler to be notified when the stream disconnects
type StreamClientHandler ¶
type StreamClientHandler interface {
UseStreamClient(client grpc.ClientConnInterface)
}
A plugin can optionally implement StreamClientHandler to obtain a grpc.ClientConnInterface to the plugin's side of the spliced stream.
type StreamDelegate ¶ added in v0.8.2
type StreamDelegate[T any] interface { WithTarget(*corev1.Reference) T WithBroadcastSelector(*corev1.ClusterSelector, Aggregator) T }
func NewDelegate ¶ added in v0.8.2
func NewDelegate[T any](cc grpc.ClientConnInterface, newClientFunc func(grpc.ClientConnInterface) T) StreamDelegate[T]
type StreamMetricsConfig ¶ added in v0.9.1
type StreamMetricsConfig struct { // Prometheus registerer Registerer prometheus.Registerer // A function called on each stream's Connect that returns a list of static // labels to attach to all metrics collected for that stream. LabelsForStream func(context.Context) []attribute.KeyValue }
Click to show internal directories.
Click to hide internal directories.