Documentation ¶
Overview ¶
Package switchcase provides chain elements acting like a switch-case statement, selecting a chain element with first succeed condition
Index ¶
- func NewNetworkServiceEndpointRegistryClient(cases ...NSEClientCase) registry.NetworkServiceEndpointRegistryClient
- func NewNetworkServiceEndpointRegistryServer(cases ...NSEServerCase) registry.NetworkServiceEndpointRegistryServer
- func NewNetworkServiceRegistryClient(cases ...NSClientCase) registry.NetworkServiceRegistryClient
- func NewNetworkServiceRegistryServer(cases ...NSServerCase) registry.NetworkServiceRegistryServer
- type NSClientCase
- type NSEClientCase
- type NSEServerCase
- type NSServerCase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNetworkServiceEndpointRegistryClient ¶
func NewNetworkServiceEndpointRegistryClient(cases ...NSEClientCase) registry.NetworkServiceEndpointRegistryClient
NewNetworkServiceEndpointRegistryClient - returns a new switchcase client.
func NewNetworkServiceEndpointRegistryServer ¶
func NewNetworkServiceEndpointRegistryServer(cases ...NSEServerCase) registry.NetworkServiceEndpointRegistryServer
NewNetworkServiceEndpointRegistryServer - returns a new switchcase server.
func NewNetworkServiceRegistryClient ¶
func NewNetworkServiceRegistryClient(cases ...NSClientCase) registry.NetworkServiceRegistryClient
NewNetworkServiceRegistryClient - returns a new switchcase client.
func NewNetworkServiceRegistryServer ¶
func NewNetworkServiceRegistryServer(cases ...NSServerCase) registry.NetworkServiceRegistryServer
NewNetworkServiceRegistryServer - returns a new switchcase server.
Types ¶
type NSClientCase ¶
type NSClientCase struct { Condition func(context.Context, *registry.NetworkService) bool Action registry.NetworkServiceRegistryClient }
NSClientCase repsenets NetworkService case for clients.
type NSEClientCase ¶
type NSEClientCase struct { Condition func(context.Context, *registry.NetworkServiceEndpoint) bool Action registry.NetworkServiceEndpointRegistryClient }
NSEClientCase repsenets NetworkServiceEndpoint case for clients.
type NSEServerCase ¶
type NSEServerCase struct { Condition func(context.Context, *registry.NetworkServiceEndpoint) bool Action registry.NetworkServiceEndpointRegistryServer }
NSEServerCase repsenets NetworkServiceEndpoint case for servers.
type NSServerCase ¶
type NSServerCase struct { Condition func(context.Context, *registry.NetworkService) bool Action registry.NetworkServiceRegistryServer }
NSServerCase repsenets NetworkService case for servers.