Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnmarshalKeyInputRequest ¶
func UnmarshalKeyInputRequest(cid string, body []byte, j audit.JournalEntry, w http.ResponseWriter) *reqres.KeyInputRequest
UnmarshalKeyInputRequest takes a JSON-encoded request body and attempts to unmarshal it into a KeyInputRequest struct. Similar to UnmarshalSecretUpsertRequest, it deals with JSON unmarshalling errors by logging, issuing an HTTP error response, and returning nil. This function is utilized within HTTP server handlers to parse incoming requests for key input operations.
Parameters:
- cid (string): Correlation ID for operation tracing and logging.
- body ([]byte): The JSON-encoded request body to be unmarshalled.
- j (audit.JournalEntry): An audit journal entry for recording the event.
- w (http.ResponseWriter): The HTTP response writer to send back errors in case of failure.
Returns:
- *reqres.KeyInputRequest: A pointer to the unmarshalled KeyInputRequest struct, or nil if unmarshalling fails.
func UnmarshalSecretUpsertRequest ¶
func UnmarshalSecretUpsertRequest(cid string, body []byte, j audit.JournalEntry, w http.ResponseWriter) *reqres.SecretUpsertRequest
UnmarshalSecretUpsertRequest takes a JSON-encoded request body and attempts to unmarshal it into a SecretUpsertRequest struct. It handles JSON unmarshalling errors by logging, responding with an HTTP error, and returning nil. This function is typically used in HTTP server handlers to process incoming requests for secret upsert operations.
Parameters:
- cid (string): Correlation ID for operation tracing and logging.
- body ([]byte): The JSON-encoded request body to be unmarshalled.
- j (audit.JournalEntry): An audit journal entry for recording the event.
- w (http.ResponseWriter): The HTTP response writer to send back errors in case of failure.
Returns:
- *reqres.SecretUpsertRequest: A pointer to the unmarshalled SecretUpsertRequest struct, or nil if unmarshalling fails.
Types ¶
This section is empty.