| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| s_vtrace "v.io/v23/services/vtrace" |
| type vtraceService struct{} |
| func (v *vtraceService) Trace(ctx *context.T, _ rpc.ServerCall, id uniqueid.Id) (vtrace.TraceRecord, error) { |
| store := vtrace.GetStore(ctx) |
| tr := store.TraceRecord(id) |
| return vtrace.TraceRecord{}, verror.New(verror.ErrNoExist, ctx, "No trace with id %x", id) |
| func (v *vtraceService) AllTraces(ctx *context.T, call s_vtrace.StoreAllTracesServerCall) error { |
| // TODO(mattr): Consider changing the store to allow us to iterate through traces |
| store := vtrace.GetStore(ctx) |
| traces := store.TraceRecords() |
| if err := call.SendStream().Send(traces[i]); err != nil { |
| func NewVtraceService() interface{} { |
| return s_vtrace.StoreServer(&vtraceService{}) |