initial commit
This commit is contained in:
commit
60fb40d61a
34 changed files with 2571 additions and 0 deletions
59
pkg/api/v1/server/routes.go
Normal file
59
pkg/api/v1/server/routes.go
Normal 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"},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue