github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/pkg/publicapi/handlerwrapper/types.go (about)

     1  package handlerwrapper
     2  
     3  import "context"
     4  
     5  type HTTPRequestInfo struct {
     6  	JobID      string `json:"JobID,omitempty"` // bacalhau job id
     7  	URI        string `json:"URI"`             // GET etc.
     8  	Method     string `json:"Method"`
     9  	StatusCode int    `json:"StatusCode"` // response code, like 200, 404
    10  	Size       int64  `json:"Size"`       // number of bytes of the response sent
    11  	Duration   int64  `json:"Duration"`   // how long did it take to
    12  
    13  	NodeID    string `json:"NodeID"`             // bacalhau node id
    14  	ClientID  string `json:"ClientID,omitempty"` // bacalhau client id
    15  	Referer   string `json:"Referer,omitempty"`
    16  	Ipaddr    string `json:"Ipaddr"`
    17  	UserAgent string `json:"UserAgent"`
    18  }
    19  
    20  type RequestInfoHandler interface {
    21  	Handle(context.Context, *HTTPRequestInfo)
    22  }