MCPcopy Create free account
hub / github.com/dagger/dagger / MarshalProtoJSONs

Function MarshalProtoJSONs

engine/clientdb/span.go:117–127  ·  view source on GitHub ↗
(protos []T)

Source from the content-addressed store, hash-verified

115}
116
117func MarshalProtoJSONs[T proto.Message](protos []T) ([]byte, error) {
118 msgs := make([]json.RawMessage, len(protos))
119 for i, msg := range protos {
120 pl, err := protojson.Marshal(msg)
121 if err != nil {
122 return nil, fmt.Errorf("failed to protojson marshal: %w", err)
123 }
124 msgs[i] = json.RawMessage(pl)
125 }
126 return json.Marshal(msgs)
127}
128
129// Attributes returns the attributes of the span
130func (ros *readOnlySpan) Attributes() []attribute.KeyValue {

Callers 3

ExportSpansMethod · 0.92
insertLogRecordParamFunction · 0.92

Calls 1

MarshalMethod · 0.65

Tested by 1