Documentation
¶
Overview ¶
Package routes holds what route options configure, for the SDK core.
Index ¶
- Variables
- func ChainStream(list []grpc.StreamServerInterceptor) grpc.StreamServerInterceptor
- func ChainUnary(list []grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor
- func Prefix(p string) (string, error)
- func ServiceOf(fullMethod string) string
- type Dispatch
- type Hosts
- type Managed
- type SchemaFiles
Constants ¶
This section is empty.
Variables ¶
var ( // ErrPrefix: an HTTP path prefix the SDK cannot announce consistently. ErrPrefix = errors.New("route: bad path prefix") )
Errors.
Functions ¶
func ChainStream ¶
func ChainStream(list []grpc.StreamServerInterceptor) grpc.StreamServerInterceptor
ChainStream folds interceptors into one, the first outermost; nil when there are none.
func ChainUnary ¶
func ChainUnary(list []grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor
ChainUnary folds interceptors into one, the first outermost; nil when there are none.
Types ¶
type Dispatch ¶
type Dispatch struct {
// contains filtered or unexported fields
}
Dispatch runs a registration's own interceptors on a gRPC server shared by several registrations: one public port is one grpc.Server, so author interceptors are keyed by the service a call's full method names.
func (*Dispatch) Add ¶
func (d *Dispatch) Add(services []string, unary []grpc.UnaryServerInterceptor, stream []grpc.StreamServerInterceptor)
Add installs the interceptors for the named services.
func (*Dispatch) ServerOptions ¶
func (d *Dispatch) ServerOptions() []grpc.ServerOption
ServerOptions installs the dispatch on a server.
func (*Dispatch) Stream ¶
func (d *Dispatch) Stream() grpc.StreamServerInterceptor
Stream runs the stream interceptors of the called service.
func (*Dispatch) Unary ¶
func (d *Dispatch) Unary() grpc.UnaryServerInterceptor
Unary runs the unary interceptors of the called service.
type Hosts ¶
type Hosts struct {
// contains filtered or unexported fields
}
Hosts serves one path prefix for several hosts, using HTTP Host matching them: an exact host, then the longest "*.suffix" wildcard, then the route without a host. A request no route matches gets 404.
type Managed ¶
type Managed struct {
Listen string
Host string
OpenAPI []byte // HTTP
SchemaFiles *SchemaFiles
// gRPC and ws-proto: interceptors of this registration only.
Unary []grpc.UnaryServerInterceptor
Stream []grpc.StreamServerInterceptor
// HTTP and ws-proto: wraps this route's handler; the first is outermost.
Middleware []func(http.Handler) http.Handler
// gRPC: serve grpc.reflection on the route's port.
Reflection bool
}
Managed is a route the SDK serves.
type SchemaFiles ¶
type SchemaFiles struct {
Files *apifiles.Files
Ref *backplanev1.APISchemaBundle
Err error
}
SchemaFiles is a file snapshot and its manifest reference (or a declaration error).