github.com/prebid/prebid-server/v2@v2.18.0/hooks/hookstage/entrypoint.go (about)

     1  package hookstage
     2  
     3  import (
     4  	"context"
     5  	"net/http"
     6  )
     7  
     8  // Entrypoint hooks are invoked at the very beginning of request processing.
     9  //
    10  // At this stage, account config is not yet available,
    11  // so it can only be defined as part of the host-level execution plan,
    12  // the account-level module config is not available.
    13  //
    14  // Rejection results in sending an empty BidResponse
    15  // with the NBR code indicating the rejection reason.
    16  type Entrypoint interface {
    17  	HandleEntrypointHook(
    18  		context.Context,
    19  		ModuleInvocationContext,
    20  		EntrypointPayload,
    21  	) (HookResult[EntrypointPayload], error)
    22  }
    23  
    24  // EntrypointPayload consists of an HTTP request and a raw body of the openrtb2.BidRequest.
    25  // For "/openrtb2/amp" endpoint the body is nil.
    26  // Hooks are allowed to modify this data using mutations.
    27  type EntrypointPayload struct {
    28  	Request *http.Request
    29  	Body    []byte
    30  }