go-playground / validator

:100:Go Struct and Field validation, including Cross Field, Cross Struct, Map, Slice and Array diving
MIT License
16.05k stars 1.29k forks source link

feat: add validator for IPv4 bind address / host:port #1282

Open rtomadpg opened 2 weeks ago

rtomadpg commented 2 weeks ago

Fixes Or Enhances

Here is a little PR to say thank you, for providing your framework.

Let's add a validator for IPv4 bind addresses.

Examples of valid input:

My use case: I need this validator for an application's config including IP based socket listener addresses, like: :9999 or 127.0.0.1:9999

Make sure that you've checked the boxes below before you submit PR:

@go-playground/validator-maintainers

coveralls commented 2 weeks ago

Coverage Status

coverage: 74.316% (+0.03%) from 74.291% when pulling e022a958d923ef3247d15e89addbbd2360341ba3 on rtomadpg:feat-add-ipv4port into a947377040f8ebaee09f20d09a745ec369396793 on go-playground:master.