command
module
Version:
v0.27.2
Opens a new window with list of versions in this module.
Published: Apr 14, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Akkurate utils
Simple http server
package main
import (
"github.com/Akkurate/utils/apiserver"
"github.com/Akkurate/utils/logging"
)
// Routes Routes
type Routes struct {
}
func (r *Routes) helloWorld() map[string]string {
return map[string]string{"hello": "world"}
}
func (r *Routes) RouteIndex(c *apiserver.Context) {
logging.Info("coming in here")
a := r.helloWorld()
a["id"] = c.GetParam("id").AsString()
c.SendJSON(a)
}
func main() {
routes := &Routes{}
routeMapping := map[string]apiserver.RouteHandler{
"get /:id": routes.RouteIndex,
}
server := apiserver.NewAPIServer(&apiserver.APIServerProps{
Port: "7777",
})
server.Start(routeMapping)
}
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
|
|
|
|
Helper functions for handling conversions between types.
|
Helper functions for handling conversions between types. |
Helper functions for handling time.Time objects.
|
Helper functions for handling time.Time objects. |
|
|
|
|
|
Logic operations. |
|
|
|
|
Helper functions for handling floats.
|
Helper functions for handling floats. |
|
|
Helper functions for handling integers.
|
Helper functions for handling integers. |
|
|
Helper functions for handling strings.
|
Helper functions for handling strings. |
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.