Move sync deps, change uuid to google and update go.mod

This commit is contained in:
Asim Aslam
2019-06-07 13:53:42 +01:00
parent 9e23855c37
commit a2fbf19341
14 changed files with 9 additions and 765 deletions

View File

@@ -6,11 +6,11 @@ import (
goapi "github.com/micro/go-micro/api"
"github.com/micro/go-micro/api/handler"
api "github.com/micro/go-micro/api/proto"
"github.com/micro/go-micro/client"
"github.com/micro/go-micro/errors"
"github.com/micro/go-micro/selector"
"github.com/micro/go-micro/util/ctx"
api "github.com/micro/go-micro/api/proto"
)
type apiHandler struct {

View File

@@ -8,9 +8,9 @@ import (
"net/http"
"strings"
api "github.com/micro/go-micro/api/proto"
"github.com/micro/go-micro/registry"
"github.com/micro/go-micro/selector"
api "github.com/micro/go-micro/api/proto"
)
func requestToProto(r *http.Request) (*api.Request, error) {

View File

@@ -31,7 +31,7 @@ import (
"time"
"unicode"
"github.com/pborman/uuid"
"github.com/google/uuid"
"gopkg.in/go-playground/validator.v9"
)
@@ -66,7 +66,7 @@ func New(eventType string, mimeType string, payload interface{}) *Event {
EventType: eventType,
CloudEventsVersion: CloudEventsVersion,
Source: "https://micro.mu",
EventID: uuid.NewUUID().String(),
EventID: uuid.New().String(),
EventTime: &now,
ContentType: mimeType,
Data: payload,

View File

@@ -10,10 +10,10 @@ import (
"strings"
"time"
"github.com/google/uuid"
"github.com/micro/go-micro/api/handler"
proto "github.com/micro/go-micro/api/proto"
"github.com/micro/go-micro/util/ctx"
"github.com/pborman/uuid"
)
type event struct {
@@ -73,7 +73,7 @@ func (e *event) ServeHTTP(w http.ResponseWriter, r *http.Request) {
ev := &proto.Event{
Name: action,
// TODO: dedupe event
Id: fmt.Sprintf("%s-%s-%s", topic, action, uuid.NewUUID().String()),
Id: fmt.Sprintf("%s-%s-%s", topic, action, uuid.New().String()),
Header: make(map[string]*proto.Pair),
Timestamp: time.Now().Unix(),
}