本文整理汇总了Golang中github.com/gengo/grpc-gateway/runtime.MustPattern函数的典型用法代码示例。如果您正苦于以下问题:Golang MustPattern函数的具体用法?Golang MustPattern怎么用?Golang MustPattern使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MustPattern函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1:
mux.Handle("POST", pattern_FlowCombination_RpcPathNestedStream_2, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
resp, err := request_FlowCombination_RpcPathNestedStream_2(runtime.AnnotateContext(ctx, req), client, req, pathParams)
if err != nil {
runtime.HTTPError(ctx, w, err)
return
}
forward_FlowCombination_RpcPathNestedStream_2(ctx, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_FlowCombination_RpcEmptyRpc_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 0}, []string{"rpc", "empty"}, ""))
pattern_FlowCombination_RpcEmptyStream_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"rpc", "empty", "stream"}, ""))
pattern_FlowCombination_StreamEmptyRpc_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"stream", "empty", "rpc"}, ""))
pattern_FlowCombination_StreamEmptyStream_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 0}, []string{"stream", "empty"}, ""))
pattern_FlowCombination_RpcBodyRpc_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 0}, []string{"rpc", "body"}, ""))
pattern_FlowCombination_RpcBodyRpc_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4, 2, 0}, []string{"rpc", "path", "a", "b", "c"}, ""))
pattern_FlowCombination_RpcBodyRpc_2 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 0}, []string{"rpc", "query"}, ""))
pattern_FlowCombination_RpcBodyRpc_3 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4, 2, 0}, []string{"rpc", "body", "path", "a", "b"}, ""))
开发者ID:JohanSJA,项目名称:grpc-gateway,代码行数:30,代码来源:flow_combination.pb.gw.go
示例2:
mux.Handle("POST", pattern_ABitOfEverythingService_BulkEcho_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
resp, err := request_ABitOfEverythingService_BulkEcho_0(runtime.AnnotateContext(ctx, req), client, req, pathParams)
if err != nil {
runtime.HTTPError(ctx, w, err)
return
}
forward_ABitOfEverythingService_BulkEcho_0(ctx, w, req, func() (proto.Message, error) { return resp.Recv() })
})
return nil
}
var (
pattern_ABitOfEverythingService_Create_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7, 1, 0, 4, 1, 5, 8, 1, 0, 4, 1, 5, 9, 1, 0, 4, 1, 5, 10, 1, 0, 4, 1, 5, 11, 2, 12, 1, 0, 4, 2, 5, 13, 1, 0, 4, 1, 5, 14, 1, 0, 4, 1, 5, 15, 1, 0, 4, 1, 5, 16, 1, 0, 4, 1, 5, 17, 1, 0, 4, 1, 5, 18}, []string{"v1", "example", "a_bit_of_everything", "float_value", "double_value", "int64_value", "separator", "uint64_value", "int32_value", "fixed64_value", "fixed32_value", "bool_value", "strprefix", "string_value", "uint32_value", "sfixed32_value", "sfixed64_value", "sint32_value", "sint64_value"}, ""))
pattern_ABitOfEverythingService_CreateBody_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "example", "a_bit_of_everything"}, ""))
pattern_ABitOfEverythingService_BulkCreate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "example", "a_bit_of_everything", "bulk"}, ""))
pattern_ABitOfEverythingService_Lookup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "example", "a_bit_of_everything", "uuid"}, ""))
pattern_ABitOfEverythingService_List_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "example", "a_bit_of_everything"}, ""))
pattern_ABitOfEverythingService_Update_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "example", "a_bit_of_everything", "uuid"}, ""))
pattern_ABitOfEverythingService_Delete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "example", "a_bit_of_everything", "uuid"}, ""))
pattern_ABitOfEverythingService_Echo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "example", "a_bit_of_everything", "echo", "value"}, ""))
开发者ID:mwitkow,项目名称:grpc-gateway,代码行数:30,代码来源:a_bit_of_everything.pb.gw.go
示例3: RegisterAPIHandler
return RegisterAPIHandler(ctx, mux, conn)
}
// RegisterAPIHandler registers the http handlers for service API to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
client := NewAPIClient(conn)
mux.Handle("GET", pattern_API_GetVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
resp, err := request_API_GetVersion_0(runtime.AnnotateContext(ctx, req), client, req, pathParams)
if err != nil {
runtime.HTTPError(ctx, w, err)
return
}
forward_API_GetVersion_0(ctx, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_API_GetVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"version"}, ""))
)
var (
forward_API_GetVersion_0 = runtime.ForwardResponseMessage
)
开发者ID:angelabier1,项目名称:pachyderm,代码行数:29,代码来源:protoversion.pb.gw.go
示例4:
mux.Handle("POST", pattern_API_GetMiles_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
resp, err := request_API_GetMiles_1(runtime.AnnotateContext(ctx, req), client, req, pathParams)
if err != nil {
runtime.HTTPError(ctx, w, req, err)
return
}
forward_API_GetMiles_1(ctx, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_API_GetAirport_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"airports", "id"}, ""))
pattern_API_GetAirline_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"airlines", "id"}, ""))
pattern_API_GetRoutes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3}, []string{"routes", "airline_id", "source_airport_id", "destination_airport_id"}, ""))
pattern_API_GetDistance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 1, 0, 4, 1, 5, 2}, []string{"distance", "source_airport_id", "destination_airport_id"}, ""))
pattern_API_GetMiles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"miles"}, ""))
pattern_API_GetMiles_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"miles"}, ""))
)
var (
forward_API_GetAirport_0 = runtime.ForwardResponseMessage
开发者ID:kimh,项目名称:openflights-go,代码行数:30,代码来源:openflights.pb.gw.go
示例5:
}
resp, err := request_API_Unmount_0(runtime.AnnotateContext(ctx, req), client, req, pathParams)
if err != nil {
runtime.HTTPError(ctx, w, req, err)
return
}
forward_API_Unmount_0(ctx, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_API_Init_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"init"}, ""))
pattern_API_Attach_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"attach"}, ""))
pattern_API_Detach_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"detach"}, ""))
pattern_API_Mount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"mount"}, ""))
pattern_API_Unmount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"unmount"}, ""))
)
var (
forward_API_Init_0 = runtime.ForwardResponseMessage
forward_API_Attach_0 = runtime.ForwardResponseMessage
开发者ID:ModelRocket,项目名称:openstorage,代码行数:30,代码来源:flexvolume.pb.gw.go
示例6:
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "GET, OPTIONS")
w.Header().Set("Access-Control-Allow-Headers",
"Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization",
)
resp, err := request_Slack_Invite_0(runtime.AnnotateContext(ctx, req), client, req, pathParams)
if err != nil {
runtime.HTTPError(ctx, w, err)
return
}
forward_Slack_Invite_0(ctx, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_Slack_Stats_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "slack", "stats"}, ""))
pattern_Slack_Invite_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "slack", "invite"}, ""))
)
var (
forward_Slack_Stats_0 = runtime.ForwardResponseMessage
forward_Slack_Invite_0 = runtime.ForwardResponseMessage
)
开发者ID:golanghr,项目名称:slack-invite,代码行数:30,代码来源:slackinvite.pb.gw.go
示例7:
cancel()
}
}(ctx.Done(), cn.CloseNotify())
}
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, req)
if err != nil {
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
}
resp, md, err := request_TimeSeries_Query_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
return
}
forward_TimeSeries_Query_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_TimeSeries_Query_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"ts", "query"}, ""))
)
var (
forward_TimeSeries_Query_0 = runtime.ForwardResponseMessage
)
开发者ID:CubeLite,项目名称:cockroach,代码行数:30,代码来源:timeseries.pb.gw.go
示例8:
resp, md, err := request_Admin_Cluster_0(runtime.AnnotateContext(ctx, req), client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, w, req, err)
return
}
forward_Admin_Cluster_0(ctx, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_Admin_Users_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"_admin", "v1", "users"}, ""))
pattern_Admin_Databases_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"_admin", "v1", "databases"}, ""))
pattern_Admin_DatabaseDetails_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"_admin", "v1", "databases", "database"}, ""))
pattern_Admin_TableDetails_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"_admin", "v1", "databases", "database", "tables", "table"}, ""))
pattern_Admin_Events_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"_admin", "v1", "events"}, ""))
pattern_Admin_SetUIData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"_admin", "v1", "uidata"}, ""))
pattern_Admin_GetUIData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"_admin", "v1", "uidata"}, ""))
pattern_Admin_Cluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"_admin", "v1", "cluster"}, ""))
)
开发者ID:petermattis,项目名称:cockroach,代码行数:31,代码来源:admin.pb.gw.go
示例9: RegisterDeploymentsHandler
return RegisterDeploymentsHandler(ctx, mux, conn)
}
// RegisterDeploymentsHandler registers the http handlers for service Deployments to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterDeploymentsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
client := NewDeploymentsClient(conn)
mux.Handle("GET", pattern_Deployments_GetFlagz_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
resp, err := request_Deployments_GetFlagz_0(runtime.AnnotateContext(ctx, req), client, req, pathParams)
if err != nil {
runtime.HTTPError(ctx, w, err)
return
}
forward_Deployments_GetFlagz_0(ctx, w, req, resp)
})
return nil
}
var (
pattern_Deployments_GetFlagz_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"deployment", "v3", "myapp", "deployment.name", "flagz", "name"}, ""))
)
var (
forward_Deployments_GetFlagz_0 = runtime.ForwardResponseMessage
)
开发者ID:mwitkow,项目名称:grpc-experiment,代码行数:29,代码来源:deployments.pb.gw.go
示例10:
mux.Handle("GET", pattern_API_GetDistanceByCode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
resp, err := request_API_GetDistanceByCode_0(runtime.AnnotateContext(ctx, req), client, req, pathParams)
if err != nil {
runtime.HTTPError(ctx, w, err)
return
}
forward_API_GetDistanceByCode_0(ctx, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_API_GetAllAirports_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"airports"}, ""))
pattern_API_GetAllAirlines_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"airlines"}, ""))
pattern_API_GetAllRoutes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"routes"}, ""))
pattern_API_GetAirportByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 1}, []string{"airports", "id"}, ""))
pattern_API_GetAirlineByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 1}, []string{"airlines", "id"}, ""))
pattern_API_GetRouteByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 1}, []string{"routes", "id"}, ""))
pattern_API_GetDistanceByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3}, []string{"distance", "id", "source_airport_id", "destination_airport_id"}, ""))
pattern_API_GetAirportByCode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 1}, []string{"airports", "code"}, ""))
开发者ID:bigwhite,项目名称:go-openflights,代码行数:30,代码来源:openflights.pb.gw.go
示例11:
resp, md, err := request_Status_Gossip_0(runtime.AnnotateContext(ctx, req), inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
return
}
forward_Status_Gossip_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_Status_Details_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"_status", "details", "node_id"}, ""))
pattern_Status_Details_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"health"}, ""))
pattern_Status_Nodes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"_status", "nodes"}, ""))
pattern_Status_Node_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"_status", "nodes", "node_id"}, ""))
pattern_Status_Ranges_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"_status", "ranges", "node_id"}, ""))
pattern_Status_Gossip_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"_status", "gossip", "node_id"}, ""))
)
var (
forward_Status_Details_0 = runtime.ForwardResponseMessage
开发者ID:JKhawaja,项目名称:cockroach,代码行数:30,代码来源:status.pb.gw.go
示例12: RegisterHelloHandler
return RegisterHelloHandler(ctx, mux, conn)
}
// RegisterHelloHandler registers the http handlers for service Hello to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterHelloHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
client := NewHelloClient(conn)
mux.Handle("GET", pattern_Hello_HelloWorld_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
resp, err := request_Hello_HelloWorld_0(runtime.AnnotateContext(ctx, req), client, req, pathParams)
if err != nil {
runtime.HTTPError(ctx, w, err)
return
}
forward_Hello_HelloWorld_0(ctx, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_Hello_HelloWorld_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "example", "hello"}, ""))
)
var (
forward_Hello_HelloWorld_0 = runtime.ForwardResponseMessage
)
开发者ID:golanghr,项目名称:platform-examples,代码行数:29,代码来源:hello.pb.gw.go
示例13:
}
resp, md, err := request_StreamService_BulkEcho_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
return
}
forward_StreamService_BulkEcho_0(ctx, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_StreamService_BulkCreate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "example", "a_bit_of_everything", "bulk"}, ""))
pattern_StreamService_List_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "example", "a_bit_of_everything"}, ""))
pattern_StreamService_BulkEcho_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "example", "a_bit_of_everything", "echo"}, ""))
)
var (
forward_StreamService_BulkCreate_0 = runtime.ForwardResponseMessage
forward_StreamService_List_0 = runtime.ForwardResponseStream
forward_StreamService_BulkEcho_0 = runtime.ForwardResponseStream
)
开发者ID:digitalfishpond,项目名称:dashboard,代码行数:30,代码来源:stream.pb.gw.go
示例14:
if ok {
go func() {
<-closeNotifier.CloseNotify()
cancel()
}()
}
resp, err := request_EchoService_EchoBody_0(runtime.AnnotateContext(ctx, req), client, req, pathParams)
if err != nil {
runtime.HTTPError(ctx, w, req, err)
return
}
forward_EchoService_EchoBody_0(ctx, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_EchoService_Echo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "example", "echo", "id"}, ""))
pattern_EchoService_EchoBody_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "example", "echo_body"}, ""))
)
var (
forward_EchoService_Echo_0 = runtime.ForwardResponseMessage
forward_EchoService_EchoBody_0 = runtime.ForwardResponseMessage
)
开发者ID:floridoo,项目名称:grpc-gateway,代码行数:30,代码来源:echo_service.pb.gw.go
示例15:
mux.Handle("GET", pattern_Api_ListCommits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
resp, err := request_Api_ListCommits_0(runtime.AnnotateContext(ctx, req), client, req, pathParams)
if err != nil {
runtime.HTTPError(ctx, w, err)
return
}
forward_Api_ListCommits_0(ctx, w, req, resp)
})
return nil
}
var (
pattern_Api_InitRepository_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"repos", "repository.name"}, ""))
pattern_Api_ListRepositories_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"repos"}, ""))
pattern_Api_GetFile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3}, []string{"files", "path.commit.repository.name", "path.commit.id", "path.path"}, ""))
pattern_Api_GetFileInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3}, []string{"fileinfos", "path.commit.repository.name", "path.commit.id", "path.path"}, ""))
pattern_Api_MakeDirectory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3}, []string{"directories", "path.commit.repository.name", "path.commit.id", "path.path"}, ""))
pattern_Api_PutFile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3}, []string{"files", "path.commit.repository.name", "path.commit.id", "path.path"}, ""))
pattern_Api_ListFiles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3}, []string{"directories", "path.commit.repository.name", "path.commit.id", "path.path"}, ""))
pattern_Api_Branch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 1, 0, 4, 1, 5, 2}, []string{"commits", "commit.repository.name", "commit.id"}, ""))
开发者ID:kunthar,项目名称:pachyderm,代码行数:30,代码来源:pfs.pb.gw.go
示例16: RegisterAPIHandler
return RegisterAPIHandler(ctx, mux, conn)
}
// RegisterAPIHandler registers the http handlers for service API to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
client := NewAPIClient(conn)
mux.Handle("PUT", pattern_API_CreateRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
resp, err := request_API_CreateRepo_0(runtime.AnnotateContext(ctx, req), client, req, pathParams)
if err != nil {
runtime.HTTPError(ctx, w, err)
return
}
forward_API_CreateRepo_0(ctx, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_API_CreateRepo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"repos", "repo.name"}, ""))
)
var (
forward_API_CreateRepo_0 = runtime.ForwardResponseMessage
)
开发者ID:angelabier1,项目名称:pachyderm,代码行数:29,代码来源:pfs.pb.gw.go
示例17:
mux.Handle("POST", pattern_YourService_Echo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(ctx)
closeNotifier, ok := w.(http.CloseNotifier)
if ok {
go func() {
<-closeNotifier.CloseNotify()
cancel()
}()
}
resp, err := request_YourService_Echo_0(runtime.AnnotateContext(ctx, req), client, req, pathParams)
if err != nil {
runtime.HTTPError(ctx, w, req, err)
return
}
forward_YourService_Echo_0(ctx, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_YourService_Echo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "example", "echo"}, ""))
)
var (
forward_YourService_Echo_0 = runtime.ForwardResponseMessage
)
开发者ID:philips,项目名称:hacks,代码行数:29,代码来源:service.pb.gw.go
示例18:
resp, md, err := request_API_ListVolumes_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
return
}
forward_API_ListVolumes_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_API_Create_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"VolumeDriver.Create"}, ""))
pattern_API_Remove_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"VolumeDriver.Remove"}, ""))
pattern_API_Path_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"VolumeDriver.Path"}, ""))
pattern_API_Mount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"VolumeDriver.Mount"}, ""))
pattern_API_Unmount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"VolumeDriver.Unmount"}, ""))
pattern_API_Cleanup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api", "cleanup"}, ""))
pattern_API_GetVolume_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"api", "volumes", "name"}, ""))
pattern_API_ListVolumes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api", "volumes"}, ""))
)
开发者ID:peter-edge,项目名称:dockervolume-go,代码行数:31,代码来源:dockervolume.pb.gw.go
示例19:
cancel()
}
}(ctx.Done(), cn.CloseNotify())
}
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, req)
if err != nil {
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
}
resp, md, err := request_API_Activate_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, outboundMarshaler, w, req, err)
return
}
forward_API_Activate_0(ctx, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_API_Activate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"Plugin.Activate"}, ""))
)
var (
forward_API_Activate_0 = runtime.ForwardResponseMessage
)
开发者ID:peter-edge,项目名称:dockerplugin-go,代码行数:30,代码来源:dockerplugin.pb.gw.go
注:本文中的github.com/gengo/grpc-gateway/runtime.MustPattern函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论