factory

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package factory provides upstream factory functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory interface {
	// NewUpstream creates a new upstream service instance based on the provided
	// configuration.
	NewUpstream(config *configv1.UpstreamServiceConfig) (upstream.Upstream, error)
}

Factory defines the interface for a factory that creates upstream service instances.

func NewUpstreamServiceFactory

func NewUpstreamServiceFactory(poolManager *pool.Manager) Factory

NewUpstreamServiceFactory creates a new UpstreamServiceFactory.

poolManager is the connection pool manager used by upstreams that require connection pooling (e.g., gRPC, HTTP, WebSocket).

type UpstreamServiceFactory

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

UpstreamServiceFactory is a concrete implementation of the Factory interface. It creates different types of upstream services based on the service configuration.

func (*UpstreamServiceFactory) NewUpstream

NewUpstream creates and returns an appropriate upstream.Upstream implementation based on the type of service specified in the configuration.

config is the configuration for the upstream service. It returns a new upstream service instance or an error if the service type is unknown.

Jump to

Keyboard shortcuts

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