mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-07 02:07:58 +00:00
Add vendor folder to git
This commit is contained in:
parent
66cf5eaafb
commit
183585f56f
6916 changed files with 2629581 additions and 1 deletions
35
vendor/github.com/grpc-ecosystem/grpc-gateway/examples/server/echo.go
generated
vendored
Normal file
35
vendor/github.com/grpc-ecosystem/grpc-gateway/examples/server/echo.go
generated
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"github.com/golang/glog"
|
||||
examples "github.com/grpc-ecosystem/grpc-gateway/examples/examplepb"
|
||||
"golang.org/x/net/context"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/metadata"
|
||||
)
|
||||
|
||||
// Implements of EchoServiceServer
|
||||
|
||||
type echoServer struct{}
|
||||
|
||||
func newEchoServer() examples.EchoServiceServer {
|
||||
return new(echoServer)
|
||||
}
|
||||
|
||||
func (s *echoServer) Echo(ctx context.Context, msg *examples.SimpleMessage) (*examples.SimpleMessage, error) {
|
||||
glog.Info(msg)
|
||||
return msg, nil
|
||||
}
|
||||
|
||||
func (s *echoServer) EchoBody(ctx context.Context, msg *examples.SimpleMessage) (*examples.SimpleMessage, error) {
|
||||
glog.Info(msg)
|
||||
grpc.SendHeader(ctx, metadata.New(map[string]string{
|
||||
"foo": "foo1",
|
||||
"bar": "bar1",
|
||||
}))
|
||||
grpc.SetTrailer(ctx, metadata.New(map[string]string{
|
||||
"foo": "foo2",
|
||||
"bar": "bar2",
|
||||
}))
|
||||
return msg, nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue