tag

package module
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: MIT Imports: 5 Imported by: 7 modules, 7 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

Tag - Struct Tag Parser And Decoder

PkgGoDev Build Status Go Report Card Coverage Status GitHub issues Release

Installation

To install the package, run:

go get github.com/go-zoox/tag

Features

  • Type Validation
    • omitempty, such as tag:"app_name,omitempty"
    • required, such as tag:"app_name,required"
    • default, such as tag:"app_name,default=my_app"
    • enum, such as tag:"app_name,enum=my_app|my_app2"
    • regexp, such as tag:"app_name,regexp=/^[a-zA-Z0-9_]+$/
    • min, such as tag:"app_name,min=1
      • if type is string, means the length of string
      • if type is int64, means the minimum value of int
    • max, such as tag:"app_name,max=10
      • if type is string, means the length of string
      • if type is int64, means the maximum value of int
  • Auto Type Transform

Getting Started

// see test cases in tag_test.go

License

GoZoox is released under the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "1.3.5"

Version is the version of tag.

Functions

This section is empty.

Types

type Tag

type Tag struct {
	Name       string
	DataSource datasource.DataSource
}

Tag is a struct tag parser and decoder

func New

func New(name string, dataSource datasource.DataSource) *Tag

New creates a new Tag

func (*Tag) Decode

func (t *Tag) Decode(ptr interface{}) error

Decode decodes the given struct pointer from data source.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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