Documentation ¶
Overview ¶
+kubebuilder:validation:Optional
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Constructor ¶
type Constructor struct { ConfigKey string Name string DefaultConfig ListenerConfig }
Constructor holds fields to create an annotated Listener.
func (Constructor) ProvideAnnotated ¶
func (constructor Constructor) ProvideAnnotated() fx.Annotated
ProvideAnnotated provides an annotated instance of Listener.
type GMuxConstructor ¶
type GMuxConstructor struct { // Name of HTTP Server instance HTTPServerName string // Name of GRPC listener instance ListenerName string }
GMuxConstructor holds fields to create an annotated instance gmux Listener.
func (GMuxConstructor) Annotate ¶
func (constructor GMuxConstructor) Annotate() fx.Option
Annotate creates an annotated instance of gmux Listener.
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener wraps net.Listener, that can be potentially not-yet-started.
func ProvideTestListener ¶
ProvideTestListener provides a listener which will choose the port to listen to on its own. Use fx.Populate an `port = lis.GetListener().Addr().(*net.TCPAddr).Port` to obtain actual port number
Note: This is a separate function, because Addr: ":0" fails hostname_port validation thus cannot go through Unmarshaller-based constructor.
func (*Listener) GetListener ¶
GetListener returns wrapped Listener
This function is supposed to only be called in the Start stage. Otherwise, this function will panic.
type ListenerConfig ¶
type ListenerConfig struct { // Keep-alive period - 0 = enabled if supported by protocol or OS. If negative then keep-alive is disabled. KeepAlive config.Duration `json:"keep_alive" validate:"gte=0s" default:"180s"` // Address to bind to in the form of [host%zone]:port Addr string `json:"addr" validate:"hostname_port" default:":8080"` // TCP networks - "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only) Network string `json:"network" validate:"oneof=tcp tcp4 tcp6" default:"tcp"` }
ListenerConfig holds configuration for socket listeners. swagger:model +kubebuilder:object:generate=true
func (*ListenerConfig) DeepCopy ¶ added in v0.1.2
func (in *ListenerConfig) DeepCopy() *ListenerConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ListenerConfig.
func (*ListenerConfig) DeepCopyInto ¶ added in v0.1.2
func (in *ListenerConfig) DeepCopyInto(out *ListenerConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ListenerIn ¶
ListenerIn is the input to Listener constructor.