config

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProviderSSE is the SSE provider.
	ProviderSSE = "sse"
	// ProviderWebSocket is the websocket provider.
	ProviderWebSocket = "websocket"
)

Variables

View Source
var (
	// Providers provides event stream construction for dependency injection.
	Providers = wire.NewSet(
		ProvideEventStreamUpgrader,
	)

	// BidirectionalProviders provides bidirectional event stream construction for dependency injection.
	BidirectionalProviders = wire.NewSet(
		ProvideBidirectionalEventStreamUpgrader,
	)
)

Functions

func ProvideBidirectionalEventStreamUpgrader

func ProvideBidirectionalEventStreamUpgrader(tracerProvider tracing.TracerProvider, cfg *Config) (eventstream.BidirectionalEventStreamUpgrader, error)

ProvideBidirectionalEventStreamUpgrader provides a BidirectionalEventStreamUpgrader based on configuration.

func ProvideEventStreamUpgrader

func ProvideEventStreamUpgrader(tracerProvider tracing.TracerProvider, cfg *Config) (eventstream.EventStreamUpgrader, error)

ProvideEventStreamUpgrader provides an EventStreamUpgrader based on configuration.

func RegisterBidirectionalEventStreamUpgrader

func RegisterBidirectionalEventStreamUpgrader(i do.Injector)

RegisterBidirectionalEventStreamUpgrader registers an eventstream.BidirectionalEventStreamUpgrader with the injector.

func RegisterEventStreamUpgrader

func RegisterEventStreamUpgrader(i do.Injector)

RegisterEventStreamUpgrader registers an eventstream.EventStreamUpgrader with the injector.

Types

type Config

type Config struct {
	WebSocket *websocket.Config `env:"init"     envPrefix:"WEBSOCKET_" json:"websocket,omitempty"`
	Provider  string            `env:"PROVIDER" json:"provider"`
}

Config is the configuration for the event stream provider.

func (*Config) ValidateWithContext

func (cfg *Config) ValidateWithContext(ctx context.Context) error

ValidateWithContext validates a Config struct.

Jump to

Keyboard shortcuts

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