Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Options( fx.Provide(ProvideFromEntities), fx.Provide(NewMetrics), )
Module is a set of default providers for servicegetter components.
Functions ¶
This section is empty.
Types ¶
type FxIn ¶
type FxIn struct { fx.In Lifecycle fx.Lifecycle Entities *entities.Entities EntityTrackers *entities.EntityTrackers Metrics *Metrics `optional:"true"` }
FxIn are FX arguments to ProvideFromEntities.
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics is used for collecting metrics about servicegetter
nil value of Metrics should be always usable.
func NewMetrics ¶
func NewMetrics(registry *prometheus.Registry) (*Metrics, error)
NewMetrics creates new Metrics, registering counters in given registry.
type ServiceGetter ¶
type ServiceGetter interface { ServicesFromContext(ctx context.Context) []string ServicesFromSocketAddress(addr *corev3.SocketAddress) []string ServicesFromAddress(addr string) []string }
ServiceGetter can be used to query services based on client context.
func FromEntities ¶
func FromEntities(ec *entities.Entities) ServiceGetter
FromEntities creates a new Entities-powered ServiceGetter.
func NewEmpty ¶
func NewEmpty() ServiceGetter
NewEmpty creates a new ServiceGetter that always returns nil.
func ProvideFromEntities ¶
func ProvideFromEntities(in FxIn) ServiceGetter
ProvideFromEntities provides an Entities-powered ServiceGetter.
Click to show internal directories.
Click to hide internal directories.