Skip to content

chadkouse/bouncer

Repository files navigation

Bouncer

Validation for go http handlers

Usage

    
    type Foo struct {
        Id    int64   `json:"-" create:"-" patch:"-"`
        Name  string  `json:"name" create:"required"`
    }

    http.Handle('/foo", NewBouncerHandler(Foo{}, fooHandler)

using "-" for create or patch tags indicates this field is immutable and will throw an error if it is found (and not the zero value for that type)

About

Validation for go http handlers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages