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