{"id":18359609,"url":"https://github.com/fn-code/govals","last_synced_at":"2025-04-06T13:32:07.731Z","repository":{"id":57499826,"uuid":"185052682","full_name":"fn-code/govals","owner":"fn-code","description":"Go library for validate data","archived":false,"fork":false,"pushed_at":"2022-06-14T09:14:32.000Z","size":24,"stargazers_count":9,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T01:25:00.569Z","etag":null,"topics":["go","go-library","go-packages","go-programming","golang","validate","validation","validation-library"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fn-code.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-05T15:59:05.000Z","updated_at":"2024-07-07T14:21:11.000Z","dependencies_parsed_at":"2022-08-28T16:10:45.998Z","dependency_job_id":null,"html_url":"https://github.com/fn-code/govals","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fn-code%2Fgovals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fn-code%2Fgovals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fn-code%2Fgovals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fn-code%2Fgovals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fn-code","download_url":"https://codeload.github.com/fn-code/govals/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247488640,"owners_count":20946975,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","go-library","go-packages","go-programming","golang","validate","validation","validation-library"],"created_at":"2024-11-05T22:23:44.928Z","updated_at":"2025-04-06T13:32:06.350Z","avatar_url":"https://github.com/fn-code.png","language":"Go","readme":"# Govals\nGovals is a go/golang package for validate data, using struct and etc. govals have custom function like validate email, numeric, alpha, alpha numeric, date, time, phone number, and length of int or string, i hope soon i will add more function for validate data.\n# Example\nexample how to use govals, you can open folder [example](https://github.com/fn-code/govals/tree/master/example)\n# Usage\nRun this command `go get github.com/fn-code/govals` to use this library\n- ### Basic Functions\n    this is basic function you can use to validate your data:\n    ```go\n    ok, err := govals.Length(1000, 2, 10)\n\tif err != nil {\n        log.Println(err)\n    }\n    if !ok {\n        // bla bla bla\n    }\n    ```\n- ### Struct\n    in struct you can use `govals` tag like this:\n    ```go\n    Name    string `govals:\"len, max=22, min=10\"`\n\tAge     int8   `govals:\"len, min=18, max=20\"`\n\tEmail   string `govals:\"email\"`\n\tDate    string `govals:\"date\"`\n\tTimes   string `govals:\"time\"`\n\tHoby    string `govals:\"alpha\"`\n\tMax     string `govals:\"numeric\"`\n\tText    string `govals:\"alphaNumeric\"`\n\tPhone   string `govals:\"phone\"`\n    Address string `govals:\"custom, regex=[^(a-zA-Z)]\"`\n    ```\n    - `len, min=10, max=22` validate length of string or int\n    - `email` validate string of email\n    - `date` validate date of string if match, like 09-12-1996 or 09/12/1996\n    - `time` validate time if match, like 12:00:01 or 12:01\n    - `alpha`validate string if contains alpha character\n    - `numeric`validate string if contains numeric\n    - `alphaNumeric` validate string if contains alpha numeric character\n    - `phone` validate string if valid phone number format\n    - `custom` validate custom rule, using regexp, you can write your own rule to validate data\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffn-code%2Fgovals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffn-code%2Fgovals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffn-code%2Fgovals/lists"}