pubsub

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigChangeEvent

type ConfigChangeEvent struct {
	ChangeType ConfigChangeType
	Operation  string // INSERT, UPDATE, DELETE
}

ConfigChangeEvent represents a configuration change notification

type ConfigChangeHandler

type ConfigChangeHandler func(event ConfigChangeEvent)

ConfigChangeHandler is a callback function for config changes

type ConfigChangeType

type ConfigChangeType string

ConfigChangeType represents the type of configuration change

const (
	ChangeTypeProviderConfig     ConfigChangeType = "provider_configs"
	ChangeTypeAPIKey             ConfigChangeType = "api_keys"
	ChangeTypeVirtualKey         ConfigChangeType = "virtual_keys"
	ChangeTypeVirtualKeyProvider ConfigChangeType = "virtual_key_providers"
	ChangeTypeVirtualKeyModel    ConfigChangeType = "virtual_key_models"
)

type PubSub

type PubSub struct {
	// contains filtered or unexported fields
}

PubSub handles PostgreSQL LISTEN/NOTIFY for configuration changes

func NewPubSub

func NewPubSub(conf *config.Config) *PubSub

NewPubSub creates a new PubSub instance

func (*PubSub) Start

func (ps *PubSub) Start() error

Start begins listening for notifications

func (*PubSub) Stop

func (ps *PubSub) Stop()

Stop closes the listener

func (*PubSub) Subscribe

func (ps *PubSub) Subscribe(handler ConfigChangeHandler)

Subscribe adds a handler for config change events

Jump to

Keyboard shortcuts

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