util

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DirektivDebug         = "DIREKTIV_DEBUG"
	DirektivLogFormat     = "DIREKTIV_LOG_FORMAT"
	DirektivOpentelemetry = "DIREKTIV_OTLP"
	DirektivFlowEndpoint  = "DIREKTIV_FLOW_ENDPOINT"

	DirektivProxyHTTPS = "HTTPS_PROXY"
	DirektivProxyHTTP  = "HTTP_PROXY"
	DirektivProxyNO    = "NO_PROXY"
)
View Source
const (
	InstanceStatusPending   = "pending"
	InstanceStatusFailed    = "failed"
	InstanceStatusCrashed   = "crashed"
	InstanceStatusComplete  = "complete"
	InstanceStatusCancelled = "cancelled"
)
View Source
const (
	RegexPattern    = NameRegexPattern
	VarRegexPattern = VarNameRegexPattern
)
View Source
const (
	VarScopeNamespace  = "namespace"
	VarScopeWorkflow   = "workflow"
	VarScopeInstance   = "instance"
	VarScopeThread     = "thread"
	VarScopeSystem     = "system"
	VarScopeFileSystem = "file"
)
View Source
const (
	CallerCron = "cron"
)
View Source
const NameRegexFragment = `(([a-zA-Z][a-zA-Z0-9_\-\.]*[a-zA-Z0-9])|([a-zA-Z]))`
View Source
const NameRegexPattern = `^` + NameRegexFragment + `$`
View Source
const (
	PaginationKeyName = "NAME"
)
View Source
const RefRegexFragment = `(([a-zA-Z0-9][a-zA-Z0-9_\-\.]*[a-zA-Z0-9])|([a-zA-Z0-9]))`
View Source
const RefRegexPattern = `^` + RefRegexFragment + `$`
View Source
const URIRegexPattern = `^(` + NameRegexFragment + `[\/]?)*$`
View Source
const VarNameRegexPattern = `^(([a-zA-Z][a-zA-Z0-9_\-\.]*[a-zA-Z0-9])|([a-zA-Z]))$`
View Source
const VarSecretNameAndSecretsFolderNamePattern = `^(([a-zA-Z][a-zA-Z0-9_\-\./]*[a-zA-Z0-9/])|([a-zA-Z/]))$`

Variables

View Source
var TelemetryMiddleware = func(h http.Handler) http.Handler {
	return h
}

Functions

func AddGlobalGRPCDialOption

func AddGlobalGRPCDialOption(opt grpc.DialOption)

func AddGlobalGRPCServerOption

func AddGlobalGRPCServerOption(opt grpc.ServerOption)

func DecryptData added in v0.8.0

func DecryptData(key, data []byte) ([]byte, error)

func DecryptDataBase64 added in v0.8.0

func DecryptDataBase64(key []byte, data string) (string, error)

func EncryptData added in v0.8.0

func EncryptData(key, data []byte) ([]byte, error)

func EncryptDataBase64 added in v0.8.0

func EncryptDataBase64(key, data []byte) (string, error)

func GetEndpointTLS

func GetEndpointTLS(service string) (*grpc.ClientConn, error)

GetEndpointTLS creates a grpc client.

func GrpcServerOptions

func GrpcServerOptions(unaryInterceptor grpc.UnaryServerInterceptor, streamInterceptor grpc.StreamServerInterceptor) []grpc.ServerOption

func GrpcStart

func GrpcStart(server **grpc.Server, name, bind string, register func(srv *grpc.Server)) error

GrpcStart starts a grpc server.

func InitTelemetry

func InitTelemetry(addr string, svcName, imName string) (func(), error)

func MatchesRegex

func MatchesRegex(s string) bool

MatchesRegex responds true if the provided string matches the RegexPattern constant defined in this package.

func MatchesVarRegex

func MatchesVarRegex(s string) bool

func MatchesVarSNameAndSFName added in v0.7.1

func MatchesVarSNameAndSFName(s string) bool

func Trace

func Trace(ctx context.Context, msg string)

func TraceGWHTTPRequest added in v0.8.1

func TraceGWHTTPRequest(ctx context.Context, r *http.Request, instrumentationName string) (cleanup func())

func TraceHTTPRequest

func TraceHTTPRequest(ctx context.Context, r *http.Request) (cleanup func())

func TransplantTelemetryContextInformation

func TransplantTelemetryContextInformation(a, b context.Context) context.Context

Types

type GenericTelemetryCarrier

type GenericTelemetryCarrier struct {
	Trace map[string]string
}

func (*GenericTelemetryCarrier) Get

func (*GenericTelemetryCarrier) Keys

func (c *GenericTelemetryCarrier) Keys() []string

func (*GenericTelemetryCarrier) Set

func (c *GenericTelemetryCarrier) Set(key, val string)

Jump to

Keyboard shortcuts

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