github.com/blend/go-sdk@v1.20220411.3/web/tracer.go (about)

     1  /*
     2  
     3  Copyright (c) 2022 - Present. Blend Labs, Inc. All rights reserved
     4  Use of this source code is governed by a MIT license that can be found in the LICENSE file.
     5  
     6  */
     7  
     8  package web
     9  
    10  // Tracer is a type that traces complete requests.
    11  type Tracer interface {
    12  	Start(*Ctx) TraceFinisher
    13  }
    14  
    15  // TraceFinisher is a finisher for a trace.
    16  type TraceFinisher interface {
    17  	Finish(*Ctx, error)
    18  }
    19  
    20  // ViewTracer is a type that can listen for view rendering traces.
    21  type ViewTracer interface {
    22  	StartView(*Ctx, *ViewResult) ViewTraceFinisher
    23  }
    24  
    25  // ViewTraceFinisher is a finisher for view traces.
    26  type ViewTraceFinisher interface {
    27  	FinishView(*Ctx, *ViewResult, error)
    28  }