diff mbox series

[bug#44562,05/15] gnu: Add go-gopkg-in-go-playground-validator-v9.

Message ID 87r1p096cq.fsf@lafreniere.xyz
State New
Headers show
Series [bug#44562,01/15] gnu: Add go-github-com-leodido-go-urn. | expand


Context Check Description
cbaines/submitting builds success
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job

Commit Message

Joseph LaFreniere Nov. 10, 2020, 10:47 p.m. UTC
Joseph LaFreniere
diff mbox series


From e4b414d320e2f77bbe07719484822cea855a57b6 Mon Sep 17 00:00:00 2001
From: Joseph LaFreniere <joseph@lafreniere.xyz>
Date: Sun, 26 Jul 2020 23:42:48 -0500
Subject: [PATCH 05/15] gnu: Add go-gopkg-in-go-playground-validator-v9.

* gnu/packages/golang.scm (go-gopkg-in-go-playground-validator-v9): New variable.
 gnu/packages/golang.scm | 48 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 6742404f3f..32605fbc65 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -625,6 +625,54 @@  professionally translated
 @end itemize")
     (license license:expat)))
+(define-public go-gopkg-in-go-playground-validator-v9
+  (package
+    (name "go-gopkg-in-go-playground-validator-v9")
+    (version "9.31.0")
+    (home-page "https://gopkg.in/go-playground/validator.v9")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/go-playground/validator")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1f8c77s8kx9rip2jarv27x5s4xkcmanh4ndyhbcwvrhncs5rq061"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "gopkg.in/go-playground/validator.v9"))
+    (inputs
+     `(("go-gopkg-in-go-playground-assert-v1"
+        ,go-gopkg-in-go-playground-assert-v1)
+       ("go-github-com-go-playground-locales"
+        ,go-github-com-go-playground-locales)
+       ("go-github-com-go-playground-universal-translator"
+        ,go-github-com-go-playground-universal-translator)
+       ("go-github-com-leodido-go-urn" ,go-github-com-leodido-go-urn)))
+    (synopsis "Validator for structs and individual fields based on tags")
+    (description
+     "This package implements value validations for structs and individual
+fields based on tags.  It has the following unique features:
+@item Cross Field and Cross Struct validations by using validation tags or custom validators
+@item Slice, Array and Map diving, which allows any or all levels of a multidimensional field to be validated
+@item Ability to dive into both map keys and values for validation
+@item Handles type interface by determining it's underlying type prior to validation
+@item Handles custom field types such as sql driver
+@item Alias validation tags, which allows for mapping of several validations
+to a single tag for easier defining of validations on structs
+@item Extraction of custom defined Field Name e.g. can specify to extract the
+JSON name while validating and have it available in the resulting FieldError
+@item Customizable i18n aware error messages.
+@item Default validator for the @uref{https://github.com/gin-gonic/gin, gin}
+web framework
+@end itemize")
+    (license license:expat)))
 (define-public go-gopkg.in-tomb.v2
   (let ((commit "d5d1b5820637886def9eef33e03a27a9f166942c")
         (revision "0"))