github.com/goravel/framework@v1.13.9/contracts/http/context.go (about)

     1  package http
     2  
     3  import (
     4  	"context"
     5  )
     6  
     7  type Middleware func(Context)
     8  type HandlerFunc func(Context) Response
     9  type ResourceController interface {
    10  	// Index method for controller
    11  	Index(Context) Response
    12  	// Show method for controller
    13  	Show(Context) Response
    14  	// Store method for controller
    15  	Store(Context) Response
    16  	// Update method for controller
    17  	Update(Context) Response
    18  	// Destroy method for controller
    19  	Destroy(Context) Response
    20  }
    21  
    22  //go:generate mockery --name=Context
    23  type Context interface {
    24  	context.Context
    25  	// Context returns the Context
    26  	Context() context.Context
    27  	// WithValue add value associated with key in context
    28  	WithValue(key string, value any)
    29  	// Request returns the ContextRequest
    30  	Request() ContextRequest
    31  	// Response returns the ContextResponse
    32  	Response() ContextResponse
    33  }