Documentation ¶
Index ¶
- func GenerateTLSCertAndKey(host string, validFrom time.Time, validFor time.Duration, directory string) error
- func GetGRPCClient(daprPort int) runtimev1pb.DaprClient
- func IsTruthy(val string) bool
- func LoggerMiddleware(next http.Handler) http.Handler
- func NewHTTPClient() *http.Client
- func NewHTTPClientForSocket(socketAddr string) *http.Client
- func PortFromEnv(envName string, defaultPort int) (res int)
- func StartServer(port int, appRouter func() http.Handler, allowHTTP2 bool, enableTLS bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateTLSCertAndKey ¶
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 ¶
func GetGRPCClient(daprPort int) runtimev1pb.DaprClient
GetGRPCClient returns a gRPC client to connect to Dapr
func IsTruthy ¶
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 ¶
LoggerMiddleware returns a middleware for gorilla/mux that logs all requests and processing times
func NewHTTPClient ¶
NewHTTPClient returns a HTTP client configured for our tests.
func NewHTTPClientForSocket ¶
NewHTTPClientForSocket returns a HTTP client that connects to a Unix Domain Socket.
func PortFromEnv ¶
PortFromEnv returns a port from an env var, or the default value.
Types ¶
This section is empty.