35 lines
646 B
Go
35 lines
646 B
Go
package server
|
|
|
|
import (
|
|
"git.giftfish.de/ston1th/haproxy-lb/pkg/api/types"
|
|
"git.giftfish.de/ston1th/haproxy-lb/pkg/api/v1/schema"
|
|
)
|
|
|
|
const (
|
|
healthz = "/healthz"
|
|
lbcluster = schema.LBPath + "/{cluster:[a-zA-Z0-9-]+$}"
|
|
lbclustername = schema.LBPath + "/{cluster:[a-zA-Z0-9-]+}/{name:[a-zA-Z0-9-_]+$}"
|
|
)
|
|
|
|
var Routes = []types.Route{
|
|
{
|
|
healthz,
|
|
healthzHandler,
|
|
[]string{"GET"},
|
|
},
|
|
{
|
|
schema.LBPath,
|
|
authHandler(lbListHandler),
|
|
[]string{"GET"},
|
|
},
|
|
{
|
|
lbcluster,
|
|
authHandler(lbClusterHandler),
|
|
[]string{"GET", "DELETE"},
|
|
},
|
|
{
|
|
lbclustername,
|
|
authHandler(lbHandler),
|
|
[]string{"GET", "POST", "DELETE"},
|
|
},
|
|
}
|