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 ¶
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 ¶
func (f *UpstreamServiceFactory) NewUpstream(config *configv1.UpstreamServiceConfig) (upstream.Upstream, error)
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.