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
//go:generate make proto

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -31,10 +31,10 @@ type Metadata struct {
}
type Stream struct {
Id string
Id string
Description string
Messages []*Message
Updated int64
Messages []*Message
Updated int64
}
type Message struct {
@@ -71,9 +71,9 @@ func newStore() *Store {
func newStream(id, desc string) *Stream {
return &Stream{
Id: id,
Id: id,
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+"/")
rsp.Channels = append(rsp.Channels, &pb.Channel{
Name: name,
Name: name,
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
//go:generate make proto

View File

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