reader

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseURI

func ParseURI(uri string) (*url.URL, error)

ParseURI parses URI and validates configuration information

func RegisterReader

func RegisterReader(scheme Scheme, newReader func(uri string) (ConfReader, error)) error

RegisterReader registers a reader for given scheme

Types

type ConfReader

type ConfReader interface {
	// Read reads configuration data
	Read(ctx context.Context) ([]byte, error)

	// Subscribe subscribes to configuration changes and returns update channel
	Subscribe(ctx context.Context) (<-chan *ReadEvent, error)

	// Close closes the reader and cleans up resources
	Close() error
}

ConfReader defines configuration reader interface

func GetReader

func GetReader(scheme Scheme, uri string) (ConfReader, error)

GetReader creates and returns reader for given scheme and URI

func NewReader

func NewReader(uri string) (ConfReader, error)

NewReader creates reader from URI by detecting scheme automatically

type ReadEvent

type ReadEvent struct {
	SourceURI string    `json:"source_uri"`
	Timestamp time.Time `json:"timestamp"`
	Data      []byte    `json:"data"`
	Error     error     `json:"error,omitempty"`
}

ReadEvent represents configuration update event

func NewReadEvent

func NewReadEvent(sourceURI string, data []byte, err error) *ReadEvent

NewReadEvent creates a new configuration event with validation

func (*ReadEvent) IsValid

func (e *ReadEvent) IsValid() bool

IsValid checks if the configuration event is valid

type Scheme

type Scheme string

Scheme represents protocol type

Directories

Path Synopsis
Package k8s provides a configuration reader implementation for Kubernetes ConfigMaps and Secrets.
Package k8s provides a configuration reader implementation for Kubernetes ConfigMaps and Secrets.

Jump to

Keyboard shortcuts

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