utils

package module
v0.0.0-...-0018154 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 8 Imported by: 4 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

utils

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToStruct

func ConvertToStruct(input interface{}, output interface{}) error

ConvertToStruct copies the input map to the output struct.

func ExtractValidationRules

func ExtractValidationRules(input interface{}) map[string]interface{}

ExtractValidationRules extracts validation rules from the given input struct. It iterates over the fields of the struct and checks for the presence of "json" and "validate" tags. If a "json" tag is found, it maps the tag value to the corresponding "validate" tag value in the result map. If a field is of type struct, it recursively calls ExtractValidationRules to extract validation rules from the nested struct fields. The extracted validation rules are returned as a map[string]string, where the key represents the "json" tag value and the value represents the "validate" tag value.

func NewValidator

func NewValidator() *validate.Validate

NewValidator creates a new instance of the validator.Validate struct. It registers a custom validation functions for different types.

func RenderInputTemplate

func RenderInputTemplate(input string, t *types.Task, otherTasks []*types.Task) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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