github.com/skabbes/up@v0.2.1/internal/proxy/event.go (about)

     1  package proxy
     2  
     3  // Identity is the identity information associated with the request.
     4  type Identity struct {
     5  	APIKey                        string
     6  	AccountID                     string
     7  	UserAgent                     string
     8  	SourceIP                      string
     9  	AccessKey                     string
    10  	Caller                        string
    11  	User                          string
    12  	UserARN                       string
    13  	CognitoIdentityID             string
    14  	CognitoIdentityPoolID         string
    15  	CognitoAuthenticationType     string
    16  	CognitoAuthenticationProvider string
    17  }
    18  
    19  // RequestContext is the contextual information provided by API Gateway.
    20  type RequestContext struct {
    21  	APIID        string
    22  	ResourceID   string
    23  	RequestID    string
    24  	HTTPMethod   string
    25  	ResourcePath string
    26  	AccountID    string
    27  	Stage        string
    28  	Identity     Identity
    29  	Authorizer   map[string]string `json:"-"`
    30  }
    31  
    32  // Input is the input provided by API Gateway.
    33  type Input struct {
    34  	HTTPMethod            string
    35  	Headers               map[string]string
    36  	Resource              string
    37  	PathParameters        map[string]string
    38  	Path                  string
    39  	QueryStringParameters map[string]string
    40  	Body                  string
    41  	IsBase64Encoded       bool
    42  	StageVariables        map[string]string
    43  	RequestContext        RequestContext
    44  }
    45  
    46  // Output is the output expected by API Gateway.
    47  type Output struct {
    48  	StatusCode      int               `json:"statusCode"`
    49  	Headers         map[string]string `json:"headers,omitempty"`
    50  	Body            string            `json:"body,omitempty"`
    51  	IsBase64Encoded bool              `json:"isBase64Encoded"`
    52  }