Documentation ¶
Index ¶
- Constants
- Variables
- func ComponentLogName(name, typ, version string) string
- func Contains[T comparable](s []T, v T) bool
- func ContainsPrefixed(prefixes []string, v string) bool
- func Filter[T any](items []T, test func(item T) bool) []T
- func GetConfig() *rest.Config
- func GetEnvOrElse(name, orElse string) string
- func GetHostAddress() (string, error)
- func GetIntValOrDefault(val int, defaultValue int) int
- func GetKubeClient() *kubernetes.Clientset
- func GetKubeClusterDomain() (string, error)
- func GetNamespaceOrDefault(defaultNamespace string) string
- func IsSocket(f fs.FileInfo) bool
- func MapToSlice[T comparable, V any](m map[T]V) []T
- func ParseServiceAddr(val string) []string
- func PopulateMetadataForBulkPublishEntry(reqMeta, entryMeta map[string]string) map[string]string
- func SetEnvVariables(variables map[string]string) error
- func SocketExists(socketPath string) bool
- func UppercaseRequestMiddleware(next http.Handler) http.Handler
- func UppercaseResponseMiddleware(next http.Handler) http.Handler
Constants ¶
const (
// DefaultKubeClusterDomain is the default value of KubeClusterDomain.
DefaultKubeClusterDomain = "cluster.local"
)
const (
DotDelimiter = "."
)
const (
// HostIPEnvVar is the environment variable to override host's chosen IP address.
HostIPEnvVar = "DAPR_HOST_IP"
)
Variables ¶
var (
KubeConfigVar = "KUBE_CONFIG"
)
Functions ¶
func ComponentLogName ¶
ComponentLogName returns the name of a component that can be used in logging.
func Contains ¶
func Contains[T comparable](s []T, v T) bool
Contains reports whether v is present in s. Similar to https://pkg.go.dev/golang.org/x/exp/slices#Contains.
func ContainsPrefixed ¶
ContainsPrefixed reports whether v is prefixed by any of the strings in s.
func Filter ¶
Filter returns a new slice containing all items in the given slice that satisfy the given test.
func GetEnvOrElse ¶
GetEnvOrElse get the value from the OS environment or use the else value if variable is not present.
func GetHostAddress ¶
GetHostAddress selects a valid outbound IP address for the host.
func GetIntValOrDefault ¶
GetIntValOrDefault returns an int value if greater than 0 OR default value.
func GetKubeClient ¶
func GetKubeClient() *kubernetes.Clientset
GetKubeClient gets a kubernetes client.
func GetKubeClusterDomain ¶
GetKubeClusterDomain search KubeClusterDomain value from /etc/resolv.conf file.
func GetNamespaceOrDefault ¶
GetNamespaceOrDefault returns the namespace for Dapr, or the default namespace if it is not set.
func MapToSlice ¶
func MapToSlice[T comparable, V any](m map[T]V) []T
MapToSlice is the inversion of SliceToMap. Order is not guaranteed as map retrieval order is not.
func ParseServiceAddr ¶
func SetEnvVariables ¶
SetEnvVariables set variables to environment.
func SocketExists ¶
SocketExists returns true if the file in that path is an unix socket.
func UppercaseRequestMiddleware ¶
UppercaseRequestMiddleware is a HTTP middleware that transforms the request body to uppercase
Types ¶
This section is empty.