grpcgw

package
v0.1.82 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: MIT Imports: 23 Imported by: 1

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Asset

func Asset(name string) ([]byte, error)

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

func AssetDir(name string) ([]string, error)

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

func AssetInfo(name string) (os.FileInfo, error)

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 AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func MustAsset

func MustAsset(name string) []byte

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

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

func Serve

func Serve(ctx context.Context, opt ...ServerOption) error

Serve will start http and grpc server on given ports and will use ctx.Done() channel to stop servers

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

Jump to

Keyboard shortcuts

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