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.
|
|
|
/*
|
|
|
|
------------------------------------------------------------------------------------------------------------------------
|
|
|
|
####### api ####### Copyright (c) 2021 mls-361 ##################################################### MIT License #######
|
|
|
|
------------------------------------------------------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
|
|
|
"expvar"
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"forge.chapril.org/armen/armen/internal/components"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
//_maxBodySize = 1024 * 4
|
|
|
|
)
|
|
|
|
|
|
|
|
type api struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
func newAPI() *api {
|
|
|
|
return &api{}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (api *api) createJob(rw http.ResponseWriter, r *http.Request) {
|
|
|
|
rw.WriteHeader(http.StatusOK)
|
|
|
|
}
|
|
|
|
|
|
|
|
func Build(router components.Router) {
|
|
|
|
api := newAPI()
|
|
|
|
|
|
|
|
router.Get("/debug", expvar.Handler())
|
|
|
|
router.Get("/status", http.HandlerFunc(func(rw http.ResponseWriter, _ *http.Request) {
|
|
|
|
rw.WriteHeader(http.StatusOK)
|
|
|
|
}))
|
|
|
|
|
|
|
|
router.Post("/job/create", http.HandlerFunc(api.createJob))
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
######################################################################################################## @(°_°)@ #######
|
|
|
|
*/
|