utils

package
v1.10.6-rc.2 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: Apache-2.0 Imports: 26 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateTLSCertAndKey added in v1.9.0

func GenerateTLSCertAndKey(host string, validFrom time.Time, validFor time.Duration, directory string) error

GenerateTLSCertAndKey generates a self-signed X.509 certificate for a TLS server. Outputs to 'cert.pem' and 'key.pem' and will overwrite existing files.

host: Comma-separated hostnames and IPs to generate a certificate for validFrom: The time the certificate is valid from validFor: The duration the certificate is valid for directory: Path to write the files to

func GetGRPCClient added in v1.9.0

func GetGRPCClient(daprPort int) runtimev1pb.DaprClient

GetGRPCClient returns a gRPC client to connect to Dapr

func IsTruthy added in v1.9.0

func IsTruthy(val string) bool

IsTruthy returns true if a string is a truthy value. Truthy values are "y", "yes", "true", "t", "on", "1" (case-insensitive); everything else is false.

func LoggerMiddleware

func LoggerMiddleware(next http.Handler) http.Handler

LoggerMiddleware returns a middleware for gorilla/mux that logs all requests and processing times

func NewHTTPClient

func NewHTTPClient() *http.Client

NewHTTPClient returns a HTTP client configured

func StartServer

func StartServer(port int, appRouter func() *mux.Router, allowHTTP2 bool, enableTLS bool)

StartServer starts a HTTP or HTTP2 server

Types

This section is empty.

Jump to

Keyboard shortcuts

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