Documentation ¶
Overview ¶
Code generated for package grpcgw by go-bindata DO NOT EDIT. (@generated) sources: favicon-16x16.png favicon-32x32.png index.html oauth2-redirect.html swagger-ui-bundle.js swagger-ui-bundle.js.map swagger-ui-es-bundle-core.js swagger-ui-es-bundle-core.js.map swagger-ui-es-bundle.js swagger-ui-es-bundle.js.map swagger-ui-standalone-preset.js swagger-ui-standalone-preset.js.map swagger-ui.css swagger-ui.css.map swagger-ui.js swagger-ui.js.map
Index ¶
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func MustAsset(name string) []byte
- func RegisterController(c Controller)
- func RegisterInterceptors(i Interceptor)
- func RegisterSwagger(paths, definitions map[string]interface{})
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func Serve(ctx context.Context, opt ...ServerOption) error
- type Controller
- type Interceptor
- type ServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RegisterController ¶
func RegisterController(c Controller)
RegisterController register a controller
func RegisterInterceptors ¶
func RegisterInterceptors(i Interceptor)
RegisterInterceptors register custom interceptors
func RegisterSwagger ¶
func RegisterSwagger(paths, definitions map[string]interface{})
RegisterSwagger register each service paths and definitions to show in final swagger file
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type Controller ¶
type Controller interface { InitRest(ctx context.Context, conn *grpc.ClientConn, mux *runtime.ServeMux, httpMux *http.ServeMux) InitGrpc(ctx context.Context, server *grpc.Server) }
Controller interface provide a way for each grpc and rest service to register their services in server
type Interceptor ¶
type Interceptor struct { Unary grpc.UnaryServerInterceptor Stream grpc.StreamServerInterceptor }
Interceptor interface provide a way to add custom interceptors for Unary and Stream server
type ServerOption ¶
type ServerOption interface {
// contains filtered or unexported methods
}
A ServerOption sets options such as ports, paths parameters, etc.
func GrpcPort ¶
func GrpcPort(n int) ServerOption
GrpcPort returns a ServerOption that will apply grpcPort option
func HttpPort ¶
func HttpPort(n int) ServerOption
HttpPort returns a ServerOption that will apply httpPort option
func ServeMuxOptions ¶ added in v0.1.3
func ServeMuxOptions(opts ...runtime.ServeMuxOption) ServerOption
ServeMuxOptions returns a ServerOption that will apply ServeMuxOptions option for mux
func SwaggerBaseURL ¶
func SwaggerBaseURL(s string) ServerOption
SwaggerBaseURL returns a ServerOption that will apply swaggerBaseURL option