http

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2025 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SchemeHTTP represents HTTP URI scheme
	SchemeHTTP reader.Scheme = "http"
	// SchemeHTTPS represents HTTPS URI scheme
	SchemeHTTPS reader.Scheme = "https"

	// DefaultTimeout for HTTP requests
	DefaultTimeout = 30 * time.Second
	// DefaultRetryAttempts for failed requests
	DefaultRetryAttempts = 3
	// DefaultRetryDelay between retry attempts
	DefaultRetryDelay = 1 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPConfig

type HTTPConfig struct {
	Timeout       time.Duration
	RetryAttempts int
	RetryDelay    time.Duration
	Headers       map[string]string
	TLSConfig     *tls.Config
}

HTTPConfig holds HTTP client configuration

type HTTPReader

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

HTTPReader implements ConfReader for HTTP-based configuration

func NewHTTPReader

func NewHTTPReader(uri string) (*HTTPReader, error)

NewHTTPReader creates a new HTTP reader

func (*HTTPReader) Close

func (h *HTTPReader) Close() error

Close closes the reader and cleans up resources

func (*HTTPReader) Read

func (h *HTTPReader) Read(ctx context.Context) ([]byte, error)

Read reads configuration data from HTTP endpoint

func (*HTTPReader) Subscribe

func (h *HTTPReader) Subscribe(ctx context.Context) (<-chan *reader.ReadEvent, error)

Subscribe subscribes to HTTP endpoint with SSE support for real-time updates

Jump to

Keyboard shortcuts

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