Documentation ¶
Index ¶
- Constants
- type Dispatcher
- type DispatcherConstructor
- type DispatcherError
- type DispatcherOption
- type DispatcherRepository
- func (dpr *DispatcherRepository) CreateDispatcher(name string, config map[string]string) (IDispatcher, error)
- func (dpr *DispatcherRepository) GetDispatcher(name string) (DispatcherConstructor, error)
- func (dpr *DispatcherRepository) HasDispatcher(name string) bool
- func (dpr *DispatcherRepository) RegisterDispatcher(name string, constructor DispatcherConstructor) error
- type IDispatcher
Constants ¶
View Source
const ( MaxRetryAttempts = 5 DefaultRequestTimeout = 3*time.Second + 50*time.Millisecond // Close to 3.05 DefaultServiceURL = "https://example.com/api" // Replace with actual URL )
Constants for retry attempts and request timeout
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func (*Dispatcher) Name ¶
func (d *Dispatcher) Name() string
type DispatcherConstructor ¶
type DispatcherConstructor func(config map[string]string) (IDispatcher, error)
type DispatcherError ¶
type DispatcherError struct {
Message string
}
DispatcherError custom error for Dispather
func (*DispatcherError) Error ¶
func (e *DispatcherError) Error() string
type DispatcherOption ¶
type DispatcherOption func(*Dispatcher)
func Config ¶
func Config(config map[string]any) DispatcherOption
func ID ¶
func ID(id string) DispatcherOption
func Name ¶
func Name(name string) DispatcherOption
func URL ¶
func URL(url string) DispatcherOption
type DispatcherRepository ¶
type DispatcherRepository struct { Dispatchers map[string]DispatcherConstructor // contains filtered or unexported fields }
func GetDispatcherRepository ¶
func GetDispatcherRepository() *DispatcherRepository
func NewDispatcherRepository ¶
func NewDispatcherRepository() DispatcherRepository
func (*DispatcherRepository) CreateDispatcher ¶
func (dpr *DispatcherRepository) CreateDispatcher(name string, config map[string]string) (IDispatcher, error)
func (*DispatcherRepository) GetDispatcher ¶
func (dpr *DispatcherRepository) GetDispatcher(name string) (DispatcherConstructor, error)
func (*DispatcherRepository) HasDispatcher ¶
func (dpr *DispatcherRepository) HasDispatcher(name string) bool
func (*DispatcherRepository) RegisterDispatcher ¶
func (dpr *DispatcherRepository) RegisterDispatcher(name string, constructor DispatcherConstructor) error
Click to show internal directories.
Click to hide internal directories.