feedback

command module
v0.0.0-...-eb9e1ef Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: MIT Imports: 13 Imported by: 0

README

Feedback

This is a rails inspired golang framework that uses Settle Down as its demo app.

Look at main.go to see how to use feedback.

  r.Paths = map[string]func(*Context, string, string){}
  r.Paths["models"] = handleModels
  r.Paths["sessions"] = handleSessions
  r.Paths["users"] = handleUsers
  r.Paths["about"] = handleAbout

This is the heart of the routing code. You can have three levels of:

/foo/

/foo/bar/

/foo/bar/more/

That's why each top level path takes a func with two strings. Some of the paths you get built in to feedback like sessions and users since every app will need that logic.

But notice in main.go how this app adds more routes.

func HandleSomething(c *router.Context, second, third string) {
  if second == "" {
    c.SendContentInLayout("something_index.html", nil, 200)
  } else if third != "" {
    c.NotFound = true
  } else {
    c.NotFound = true
  }
}

Each controller has a HandleSomething func like this.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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