util

package
v0.0.0-...-4c856c0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPrefixToNames

func AddPrefixToNames(rs []model.Resource, prefix string)

func AddPrefixToResourceKeyNames

func AddPrefixToResourceKeyNames(rk []model.ResourceKey, prefix string) []model.ResourceKey

func AddSuffixToNames

func AddSuffixToNames(rs []model.Resource, suffix string)

func AddSuffixToResourceKeyNames

func AddSuffixToResourceKeyNames(rk []model.ResourceKey, suffix string) []model.ResourceKey

func ClientIDFromIncomingCtx

func ClientIDFromIncomingCtx(ctx context.Context) (string, error)

ClientIDFromIncomingCtx returns the ID of the peer. Global has the ID "global" while zones have the zone name. This is also known as the peer ID.

func DubboResourceMetaToResourceMeta

func DubboResourceMetaToResourceMeta(meta *mesh_proto.DubboResource_Meta) model.ResourceMeta

func GetSupportedTypes

func GetSupportedTypes() []string

func MetadataFromIncomingCtx

func MetadataFromIncomingCtx(ctx context.Context, key string) (string, error)

func ResourceNameHasAtLeastOneOfPrefixes

func ResourceNameHasAtLeastOneOfPrefixes(resName string, prefixes ...string) bool

func ToCoreResourceList

func ToCoreResourceList(response *envoy_sd.DiscoveryResponse) (model.ResourceList, error)

func ToEnvoyResources

func ToEnvoyResources(rlist model.ResourceList) ([]envoy_types.Resource, error)

func TrimSuffixFromName

func TrimSuffixFromName(r model.Resource, suffix string)

TrimSuffixFromName is responsible for removing provided suffix with preceding dot from the name of provided model.Resource.

func ZoneTag

func ZoneTag(r model.Resource) string

Types

type CloneResourceMetaOpt

type CloneResourceMetaOpt func(*resourceMeta)

func WithLabel

func WithLabel(key, value string) CloneResourceMetaOpt

func WithName

func WithName(name string) CloneResourceMetaOpt

type NameToVersion

type NameToVersion map[string]string

Jump to

Keyboard shortcuts

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