...

Source file src/goji.io/router.go

Documentation: goji.io

     1  package goji
     2  
     3  import (
     4  	"context"
     5  	"net/http"
     6  
     7  	"goji.io/internal"
     8  )
     9  
    10  type match struct {
    11  	context.Context
    12  	p Pattern
    13  	h http.Handler
    14  }
    15  
    16  func (m match) Value(key interface{}) interface{} {
    17  	switch key {
    18  	case internal.Pattern:
    19  		return m.p
    20  	case internal.Handler:
    21  		return m.h
    22  	default:
    23  		return m.Context.Value(key)
    24  	}
    25  }
    26  
    27  var _ context.Context = match{}
    28  

View as plain text