github.com/volts-dev/volts@v0.0.0-20240120094013-5e9c65924106/internal/test/middleware.go (about)

     1  package test
     2  
     3  import "github.com/volts-dev/volts/router"
     4  
     5  type (
     6  	TestSession struct {
     7  		Id string
     8  	}
     9  )
    10  
    11  func NewTestSession(router router.IRouter) router.IMiddleware {
    12  	return &TestSession{}
    13  
    14  }
    15  
    16  func (self *TestSession) Name() string {
    17  	return "session"
    18  }
    19  
    20  func (self *TestSession) Handler(ctx router.IContext) {
    21  	ctx.Write([]byte("In TestSession"))
    22  	ctx.Next()
    23  }