Documentation ¶
Index ¶
- Constants
- func GetCustomWebhookEndpointFromContext(ctx context.Context) string
- func GetTrackingIDFromContext(ctx context.Context) string
- func GetURIFromContext(ctx context.Context) string
- func NewProxy(opts ...ProxyOption) *proxy
- type API
- type Middleware
- type Proxy
- type ProxyOption
- type Server
- type ServerOption
- func APIs(apis ...API) ServerOption
- func Credentials(credentials *tls.Config) ServerOption
- func Metrics(metrics metrics.ServerMetrics) ServerOption
- func SeverOptions(opts ...grpc.ServerOption) ServerOption
- func StreamInterceptors(interceptors ...grpc.StreamServerInterceptor) ServerOption
- func UnaryInterceptors(interceptors ...grpc.UnaryServerInterceptor) ServerOption
Constants ¶
View Source
const ( MetadataKeyTrackingID string = "tracking-id" MetadataKeyURI string = "uri" MetadataCustomWebhookEndpoint string = "custom-webhook-endpoint" )
Keys used for retrieving value from gRPC metadata
Variables ¶
This section is empty.
Functions ¶
func GetURIFromContext ¶
func NewProxy ¶
func NewProxy(opts ...ProxyOption) *proxy
NewProxy creates a RESTful proxy server that routes RESTful request to gRPC server
Types ¶
type Middleware ¶
type Middleware interface {
ServeHTTP(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
}
type ProxyOption ¶
type ProxyOption func(*proxy)
func AllowCORS ¶
func AllowCORS(origins []string) ProxyOption
AllowCORS represents the CORS origins to setup for RESTful API
func HTTPServer ¶
func HTTPServer(s *http.Server) ProxyOption
HTTPServer represents customized HTTP server to the proxy
func HttpMetrics ¶ added in v1.0.1
func HttpMetrics(opts ...metrics.Option) ProxyOption
func Middlewares ¶
func Middlewares(mws ...Middleware) ProxyOption
Middlewares represents the HTTP middlwares to be used in this proxy
func Proxies ¶
func Proxies(proxies ...Proxy) ProxyOption
Proxies represents the proxy API to be registered to the http server
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents a gRPC server
func NewServer ¶
func NewServer(opts ...ServerOption) *Server
NewServer creates a gRPC server with pre-configured services
type ServerOption ¶
type ServerOption func(*Server)
func Credentials ¶
func Credentials(credentials *tls.Config) ServerOption
Credentials for the RPC server
func Metrics ¶
func Metrics(metrics metrics.ServerMetrics) ServerOption
func SeverOptions ¶ added in v1.1.6
func SeverOptions(opts ...grpc.ServerOption) ServerOption
SeverOptions passes additional gRPC server options
func StreamInterceptors ¶
func StreamInterceptors(interceptors ...grpc.StreamServerInterceptor) ServerOption
func UnaryInterceptors ¶
func UnaryInterceptors(interceptors ...grpc.UnaryServerInterceptor) ServerOption
Click to show internal directories.
Click to hide internal directories.