initial commit

This commit is contained in:
ston1th 2023-03-14 01:43:04 +01:00
commit 60fb40d61a
34 changed files with 2571 additions and 0 deletions

View file

@ -0,0 +1,59 @@
// Copyright (C) 2023 Marius Schellenberger
package server
import (
"git.giftfish.de/ston1th/keyctl/pkg/api/types"
"git.giftfish.de/ston1th/keyctl/pkg/api/v1/schema"
"git.giftfish.de/ston1th/keyctl/pkg/core"
)
const (
healthz = "/healthz"
keyID = schema.KeyPath + core.IDRoute
keyReqID = schema.KeyPath + core.IDRoute + core.AIDRoute
reqID = schema.ReqPath + core.IDRoute
)
var Routes = []types.Route{
{
healthz,
healthzHandler,
[]string{"GET"},
},
{
schema.KeyPath,
local(keyListHandler),
[]string{"GET"},
},
{
schema.KeyPath,
local(newHandler),
[]string{"POST"},
},
{
keyID,
keyHandler,
[]string{"GET"},
},
{
keyReqID,
keyHandler,
[]string{"GET"},
},
{
keyID,
local(keyHandler),
[]string{"DELETE"},
},
{
schema.ReqPath,
local(reqListHandler),
[]string{"GET"},
},
{
reqID,
local(reqHandler),
[]string{"PUT", "DELETE"},
},
}