util

package
v0.4.11 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Endpoints

func Endpoints(service micro.Service, regService *registry.Service) ([]*registry.Endpoint, error)

func FindByEndpoint

func FindByEndpoint(service micro.Service, endpoint interface{}) ([]*registry.Service, error)

func GetEnvDefault added in v0.3.0

func GetEnvDefault(key, defaultValue string) string

func GoSafe

func GoSafe(fn func())

GoSafe will run func in goroutine safely, avoid crash from unexpected panic

func MergeFlag added in v0.3.0

func MergeFlag(flags []cli.Flag, flag cli.Flag) []cli.Flag

func ReflectFunctionName

func ReflectFunctionName(i interface{}) string

ReflectFunctionName Guess Struct.Method from the given Function

Types

type ServiceListResult

type ServiceListResult map[*registry.Service][]*registry.Endpoint

func ListEndpoints

func ListEndpoints(service micro.Service) (ServiceListResult, error)

type WrappedEndpoint

type WrappedEndpoint struct {
	Pre     string
	Handler string
}

Jump to

Keyboard shortcuts

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