Documentation ¶
Index ¶
- func CheckSSLClientFlags()
- func CheckServiceFlags()
- func DefaultCORSConfig(allowedOrigins []string) []handlers.CORSOption
- func DefaultServerTLSConfig() (*tls.Config, error)
- func GetGRPCClientDialOpts() ([]grpc.DialOption, error)
- func GetGRPCClientDialOptsServerSideTLS(isInternal bool) ([]grpc.DialOption, error)
- func HTTPLoggingMiddleware(next http.Handler) http.Handler
- func HTTPStatusFromCode(code codes.Code) int
- func HTTPStatusFromError(err error, message string) *handler.StatusError
- func InitDefaultSentry() func()
- func InitSentryFromCRD(id, crdNamespace string) func()
- func InitSentryWithDSN(id, dsn string) func()
- func PostFlagSetupAndParse()
- func SetupCommonFlags()
- func SetupSSLClientFlags()
- func SetupService(serviceName string, servicePortBase uint)
- func SetupServiceLogging()
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 ¶
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 ¶
HTTPLoggingMiddleware is a middleware function used for logging HTTP requests.
func HTTPStatusFromCode ¶
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 ¶
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. |