services

package
v0.0.0-...-0888c38 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSSLClientFlags

func CheckSSLClientFlags()

CheckSSLClientFlags checks SSL client specific flags.

func CheckServiceFlags

func CheckServiceFlags()

CheckServiceFlags checks to make sure flag values are valid.

func DefaultCORSConfig

func DefaultCORSConfig(allowedOrigins []string) []handlers.CORSOption

DefaultCORSConfig has the default config setup for CORS.

func DefaultServerTLSConfig

func DefaultServerTLSConfig() (*tls.Config, error)

DefaultServerTLSConfig has the TLS config setup by the default service flags.

func GetGRPCClientDialOpts

func GetGRPCClientDialOpts() ([]grpc.DialOption, error)

GetGRPCClientDialOpts gets default dial options for GRPC clients used for our services.

func GetGRPCClientDialOptsServerSideTLS

func GetGRPCClientDialOptsServerSideTLS(isInternal bool) ([]grpc.DialOption, error)

GetGRPCClientDialOptsServerSideTLS gets default dial options for GRPC clients accessing a server with server-side TLS.

func HTTPLoggingMiddleware

func HTTPLoggingMiddleware(next http.Handler) http.Handler

HTTPLoggingMiddleware is a middleware function used for logging HTTP requests.

func HTTPStatusFromCode

func HTTPStatusFromCode(code codes.Code) int

HTTPStatusFromCode converts a gRPC error code into the corresponding HTTP response status. Copied from: https://github.com/grpc-ecosystem/grpc-gateway/blob/master/runtime/errors.go.

func HTTPStatusFromError

func HTTPStatusFromError(err error, message string) *handler.StatusError

HTTPStatusFromError returns a HTTP Status from the given GRPC error.

func InitDefaultSentry

func InitDefaultSentry() func()

InitDefaultSentry initialize sentry with default options. The options are set based on values from viper.

func InitSentryFromCRD

func InitSentryFromCRD(id, crdNamespace string) func()

InitSentryFromCRD attempts to initialize sentry using the sentry DSN value from the Vizier CRD.

func InitSentryWithDSN

func InitSentryWithDSN(id, dsn string) func()

InitSentryWithDSN initializes sentry with the given DSN.

func PostFlagSetupAndParse

func PostFlagSetupAndParse()

PostFlagSetupAndParse does post setup flag config and parses them.

func SetupCommonFlags

func SetupCommonFlags()

SetupCommonFlags sets flags that are used by every service, even non GRPC servers.

func SetupSSLClientFlags

func SetupSSLClientFlags()

SetupSSLClientFlags sets up SSL client specific flags.

func SetupService

func SetupService(serviceName string, servicePortBase uint)

SetupService configures basic flags and defaults required by all services.

func SetupServiceLogging

func SetupServiceLogging()

SetupServiceLogging sets up a consistent logging env for all services.

Types

This section is empty.

Directories

Path Synopsis
Package httpmiddleware has services middleware utilities that we use across our services.
Package httpmiddleware has services middleware utilities that we use across our services.

Jump to

Keyboard shortcuts

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