This commit is contained in:
Asim Aslam
2021-11-18 13:02:33 +00:00
parent 7f7a87c428
commit d6d7577584
13 changed files with 27 additions and 21 deletions

View File

@@ -1,2 +1,3 @@
package main package main
//go:generate make proto //go:generate make proto

View File

@@ -369,7 +369,7 @@ func (e *Function) Describe(ctx context.Context, req *function.DescribeRequest,
rsp.Function = f rsp.Function = f
} else { } else {
rsp.Function = &function.Func{ rsp.Function = &function.Func{
Name: req.Name, Name: req.Name,
Project: req.Project, Project: req.Project,
} }
} }

View File

@@ -1,2 +1,3 @@
package main package main
//go:generate make proto //go:generate make proto

View File

@@ -13,7 +13,7 @@ import (
type Google struct { type Google struct {
Client *customsearch.Service Client *customsearch.Service
CxId string CxId string
} }
func New(apiKey, cxId string) *Google { func New(apiKey, cxId string) *Google {
@@ -22,7 +22,7 @@ func New(apiKey, cxId string) *Google {
return &Google{ return &Google{
Client: cs, Client: cs,
CxId: cxId, CxId: cxId,
} }
} }

View File

@@ -1,2 +1,3 @@
package main package main
//go:generate make proto //go:generate make proto

View File

@@ -9,8 +9,8 @@ import (
"github.com/asim/mq/broker" "github.com/asim/mq/broker"
"github.com/micro/micro/v3/service/errors" "github.com/micro/micro/v3/service/errors"
log "github.com/micro/micro/v3/service/logger" log "github.com/micro/micro/v3/service/logger"
"github.com/micro/services/pkg/tenant"
pb "github.com/micro/services/mq/proto" pb "github.com/micro/services/mq/proto"
"github.com/micro/services/pkg/tenant"
"google.golang.org/protobuf/types/known/structpb" "google.golang.org/protobuf/types/known/structpb"
) )

View File

@@ -13,9 +13,9 @@ import (
timepb "github.com/micro/services/time/proto" timepb "github.com/micro/services/time/proto"
) )
type Prayer struct{ type Prayer struct {
Geocode geocode.GeocodingService Geocode geocode.GeocodingService
Time timepb.TimeService Time timepb.TimeService
} }
func New(c client.Client) *Prayer { func New(c client.Client) *Prayer {

View File

@@ -1,2 +1,3 @@
package main package main
//go:generate make proto //go:generate make proto

View File

@@ -1,2 +1,3 @@
package main package main
//go:generate make proto //go:generate make proto

View File

@@ -31,10 +31,10 @@ type Metadata struct {
} }
type Stream struct { type Stream struct {
Id string Id string
Description string Description string
Messages []*Message Messages []*Message
Updated int64 Updated int64
} }
type Message struct { type Message struct {
@@ -71,9 +71,9 @@ func newStore() *Store {
func newStream(id, desc string) *Stream { func newStream(id, desc string) *Stream {
return &Stream{ return &Stream{
Id: id, Id: id,
Description: desc, Description: desc,
Updated: time.Now().UnixNano(), Updated: time.Now().UnixNano(),
} }
} }

View File

@@ -117,9 +117,9 @@ func (s *Stream) ListChannels(ctx context.Context, req *pb.ListChannelsRequest,
name := strings.TrimPrefix(channel.Id, id+"/") name := strings.TrimPrefix(channel.Id, id+"/")
rsp.Channels = append(rsp.Channels, &pb.Channel{ rsp.Channels = append(rsp.Channels, &pb.Channel{
Name: name, Name: name,
Description: channel.Description, Description: channel.Description,
LastActive: time.Unix(0, channel.Updated).Format(time.RFC3339Nano), LastActive: time.Unix(0, channel.Updated).Format(time.RFC3339Nano),
}) })
} }

View File

@@ -1,2 +1,3 @@
package main package main
//go:generate make proto //go:generate make proto

View File

@@ -16,14 +16,14 @@ func main() {
service.Version("latest"), service.Version("latest"),
) )
v, err := config.Get("dvla.api_key") v, err := config.Get("dvla.api_key")
if err != nil { if err != nil {
logger.Fatalf("sunnha.api_key config not found: %v", err) logger.Fatalf("sunnha.api_key config not found: %v", err)
} }
key := v.String("") key := v.String("")
if len(key) == 0 { if len(key) == 0 {
logger.Fatal("dvla.api_key config not found") logger.Fatal("dvla.api_key config not found")
} }
// Register handler // Register handler
pb.RegisterVehicleHandler(srv.Server(), handler.New(key)) pb.RegisterVehicleHandler(srv.Server(), handler.New(key))