You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
3 years ago | |
---|---|---|
README.md | 3 years ago | |
basicauth.go | 3 years ago | |
basicauth_test.go | 3 years ago | |
circle.yml | 5 years ago | |
go.mod | 3 years ago | |
go.sum | 3 years ago |
README.md
basicauth

Middleware basicauth is a basic auth checker for Tango.
Installation
go get gitea.com/tango/basicauth
Simple Example
type AuthAction struct {}
func (a *AuthAction) Get() string {
return "200"
}
func main() {
tg := tango.Classic()
tg.Use(basicauth.New(user, pass))
tg.Get("/", new(AuthAction))
}
If you don't want some action to check auth, then
type NoAuthAction struct {
basicauth.NoAuth
}
func (a *NoAuthAction) Get() string {
return "200"
}
func main() {
tg := tango.Classic()
tg.Use(basicauth.New(user, pass))
tg.Get("/", new(NoAuthAction))
}
will be ok.