switchcase

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Overview

Package switchcase provides chain elements acting like a switch-case statement, selecting a chain element with first succeed condition

Index

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.

Jump to

Keyboard shortcuts

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