package main import ( "golang.org/x/net/context" pb "loafle.com/overflow/crawler_go/grpc" ) type DataServer struct { } func (s *DataServer) Get(c context.Context, in *pb.Input) (*pb.Output, error) { output := &pb.Output{} if c, ok := g_crawlers[in.Name.String()]; ok { rd, err := c.Get(in.Id) if err != nil { // process error } output.Data = rd } else { output.Data = []byte("Not Assign Crawler") } return output, nil }