utils

package
v0.0.0-...-3ce79b3 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetQueryParamsFields

func GetQueryParamsFields(c echo.Context) []string

GetQueryParamsFields retrieve `fields“ so we can filter them in GET/

func GetStructFields

func GetStructFields(i interface{}) []string

GetStructFields retrieve json struct fields names

func IsFilterAllowed

func IsFilterAllowed(allowed []string, filters []string) bool

IsFilterAllowed check if we are allowed to filter GET with fields

func IsStringInSlice

func IsStringInSlice(a string, list []string) bool

IsStringInSlice check if a string exist in a list of strings

func RemoveStringFromSlice

func RemoveStringFromSlice(s []string, r string) []string

RemoveStringFromSlice removes a string item from a list of strings.

func SelectFields

func SelectFields(i interface{}, fields ...string) map[string]interface{}

SelectFields execlude sensitive fields

Types

type JSONTime

type JSONTime time.Time

JSONTime alias for timne.Time

func (JSONTime) MarshalJSON

func (t JSONTime) MarshalJSON() ([]byte, error)

MarshalJSON will marshall date

Jump to

Keyboard shortcuts

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