json

package
v0.26.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2024 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnmarshalKeyInputRequest

func UnmarshalKeyInputRequest(body []byte) (*reqres.KeyInputRequest, error)

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:

  • body ([]byte): The JSON-encoded request body to be unmarshalled.

Returns:

  • *reqres.KeyInputRequest: A pointer to the unmarshalled KeyInputRequest struct, or nil if unmarshalling fails.
  • error: An error if unmarshalling fails.

func UnmarshalSecretUpsertRequest

func UnmarshalSecretUpsertRequest(
	body []byte,
) (*reqres.SecretUpsertRequest, error)

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:

  • body ([]byte): The JSON-encoded request body to be unmarshalled.

Returns:

  • *reqres.SecretUpsertRequest: A pointer to the unmarshalled SecretUpsertRequest struct, or nil if unmarshalling fails.
  • error: An error if unmarshalling fails.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL