github.com/blend/go-sdk@v1.20220411.3/web/route.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  // Route is an entry in the route tree.
    11  type Route struct {
    12  	Handler
    13  	Method string
    14  	Path   string
    15  	Params []string
    16  }
    17  
    18  // String returns the path.
    19  func (r Route) String() string { return r.Path }
    20  
    21  // StringWithMethod returns a string representation of the route.
    22  // Namely: Method_Path
    23  func (r Route) StringWithMethod() string {
    24  	return r.Method + "_" + r.Path
    25  }