utils

package
v0.0.0-...-5edbed4 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(name string, fields ...[]string) bool

Contains verify if a filed is contains in a array

func GetUserID

func GetUserID(ctx *context.Context) (*string, bool)

GetUserID get userID from token

func MakeJSON

func MakeJSON(baseKey string, content interface{}) map[string]interface{}

MakeJSON return a json object for return TODO make this function more scalable or deprecate this one

Types

type ValidateError

type ValidateError struct {
	PropertyPath string `json:"propertyPath"`
	Message      string `json:"message"`
}

ValidateError handles validate errors

func ValidateUUID

func ValidateUUID(ob interface{}, fields []string) []ValidateError

ValidateUUID validate if the ob's fields is UUID

Jump to

Keyboard shortcuts

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