interfaces

package
v9.16.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2025 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package interfaces provides shared interfaces used by both the main redis package and the maintnotifications upgrade package to avoid circular dependencies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientInterface

type ClientInterface interface {
	// GetOptions returns the client options.
	GetOptions() OptionsInterface

	// GetPushProcessor returns the client's push notification processor.
	GetPushProcessor() NotificationProcessor
}

ClientInterface defines the interface that clients must implement for maintnotifications upgrades.

type NotificationProcessor

type NotificationProcessor interface {
	RegisterHandler(pushNotificationName string, handler interface{}, protected bool) error
	UnregisterHandler(pushNotificationName string) error
	GetHandler(pushNotificationName string) interface{}
}

NotificationProcessor is (most probably) a push.NotificationProcessor forward declaration to avoid circular imports

type OptionsInterface

type OptionsInterface interface {
	// GetReadTimeout returns the read timeout.
	GetReadTimeout() time.Duration

	// GetWriteTimeout returns the write timeout.
	GetWriteTimeout() time.Duration

	// GetNetwork returns the network type.
	GetNetwork() string

	// GetAddr returns the connection address.
	GetAddr() string

	// IsTLSEnabled returns true if TLS is enabled.
	IsTLSEnabled() bool

	// GetProtocol returns the protocol version.
	GetProtocol() int

	// GetPoolSize returns the connection pool size.
	GetPoolSize() int

	// NewDialer returns a new dialer function for the connection.
	NewDialer() func(context.Context) (net.Conn, error)
}

OptionsInterface defines the interface for client options. Uses an adapter pattern to avoid circular dependencies.

Jump to

Keyboard shortcuts

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