33 lines
525 B
Go
33 lines
525 B
Go
package main
|
|
|
|
import (
|
|
"errors"
|
|
"gitea.com/lunny/tango"
|
|
"github.com/jmcvetta/neoism"
|
|
"gitea.com/tango/renders"
|
|
"gitea.com/tango/authz"
|
|
"gitea.com/tango/session"
|
|
"github.com/casbin/casbin"
|
|
"github.com/graphql-go/graphql"
|
|
"github.com/graph-gophers/graphql-go"
|
|
)
|
|
|
|
type Action struct {
|
|
tango.JSON
|
|
}
|
|
|
|
func (Action) Get() interface{} {
|
|
if true {
|
|
return map[string]string{
|
|
"say": "Hello tango!",
|
|
}
|
|
}
|
|
return errors.New("something error")
|
|
}
|
|
|
|
func main() {
|
|
t := tango.Classic()
|
|
t.Get("/", new(Action))
|
|
t.Run()
|
|
}
|