utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Software Name : Remote Key Server Version: 0.9.0 SPDX-FileCopyrightText: Copyright (c) 2020 Orange SPDX-License-Identifier: MPL-2.0

This software is distributed under the Mozilla Public License 2.0, the text of which is available at https://www.mozilla.org/en-US/MPL/2.0/ or see the "LICENSE" file for more details.

Author: Glenn Feunteun, Celine Nicolas

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeHTTPJSONBodyToStruct

func DecodeHTTPJSONBodyToStruct(r *http.Request, s interface{}) *model.RksError

DecodeHTTPJSONBodyToStruct Decodes given request body inside given struct Given struct must be passed as a pointer

func UpdateTemplatedPolicy

func UpdateTemplatedPolicy(policyTpl string, s interface{}) (string, error)

func WriteStructAsJSON

func WriteStructAsJSON(w http.ResponseWriter, s interface{}) *model.RksError

WriteStructAsJson writes the given interface converted to json into the given ResponseWriter If w.WriteHeader has not been called yet, Write calls WriteHeader(http.StatusOK) before writing the data If a StatusOk is not wanted it is mandatory to set the status code before calling this function

Types

This section is empty.

Jump to

Keyboard shortcuts

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