fallback

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 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 FallbackService

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

FallbackService provides reusable fallback logic for any API endpoint

func NewFallbackService

func NewFallbackService(cfg *config.Config) *FallbackService

NewFallbackService creates a new fallback service

func (*FallbackService) Execute

func (fs *FallbackService) Execute(
	c *fiber.Ctx,
	providers []models.Alternative,
	fallbackConfig models.FallbackConfig,
	executeFunc models.ExecutionFunc,
	requestID string,
	isStream bool,
) error

Execute runs the providers with the specified fallback configuration

func (*FallbackService) GetFallbackConfig

func (fs *FallbackService) GetFallbackConfig(requestFallback *models.FallbackConfig) models.FallbackConfig

GetFallbackConfig gets the merged fallback configuration from config and request

Jump to

Keyboard shortcuts

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