Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing spans as per WRP specifications #295

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions wrp/messages.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package wrp

import (
"time"
)
//go:generate codecgen -st "wrp" -o messages_codec.go messages.go

// Typed is implemented by any WRP type which is associated with a MessageType. All
Expand Down Expand Up @@ -50,6 +53,12 @@ type Routable interface {
Response(newSource string, requestDeliveryResponse int64) Routable
}

type Money_Span struct {
Name string
Start time.Time
Duration time.Duration
}

// Message is the union of all WRP fields, made optional (except for Type). This type is
// useful for transcoding streams, since deserializing from non-msgpack formats like JSON
// has some undesirable side effects.
Expand All @@ -73,7 +82,7 @@ type Message struct {
RequestDeliveryResponse *int64 `wrp:"rdr,omitempty"`
Headers []string `wrp:"headers,omitempty"`
Metadata map[string]string `wrp:"metadata,omitempty"`
Spans [][]string `wrp:"spans,omitempty"`
Spans []Money_Span `wrp:"spans,omitempty"`
IncludeSpans *bool `wrp:"include_spans,omitempty"`
Path string `wrp:"path,omitempty"`
Payload []byte `wrp:"payload,omitempty"`
Expand Down Expand Up @@ -165,7 +174,7 @@ type SimpleRequestResponse struct {
RequestDeliveryResponse *int64 `wrp:"rdr,omitempty"`
Headers []string `wrp:"headers,omitempty"`
Metadata map[string]string `wrp:"metadata,omitempty"`
Spans [][]string `wrp:"spans,omitempty"`
Spans []Money_Span `wrp:"spans,omitempty"`
IncludeSpans *bool `wrp:"include_spans,omitempty"`
Payload []byte `wrp:"payload,omitempty"`
PartnerIDs []string `wrp:"partner_ids,omitempty"`
Expand Down Expand Up @@ -291,7 +300,7 @@ type CRUD struct {
ContentType string `wrp:"content_type,omitempty"`
Headers []string `wrp:"headers,omitempty"`
Metadata map[string]string `wrp:"metadata,omitempty"`
Spans [][]string `wrp:"spans,omitempty"`
Spans []Money_Span `wrp:"spans,omitempty"`
IncludeSpans *bool `wrp:"include_spans,omitempty"`
Status *int64 `wrp:"status,omitempty"`
RequestDeliveryResponse *int64 `wrp:"rdr,omitempty"`
Expand Down
Loading