make endpoints pointers to enable/disable them

This commit is contained in:
Tim Möhlmann 2023-09-27 18:09:00 +03:00
parent f6cb47fbbb
commit af22c1a4d8
12 changed files with 229 additions and 93 deletions

View file

@ -25,15 +25,14 @@ import (
func TestRegisterServer(t *testing.T) {
server := UnimplementedServer{}
endpoints := Endpoints{
Authorization: Endpoint{
Authorization: &Endpoint{
path: "/auth",
},
}
decoder := schema.NewDecoder()
logger := slog.New(slog.NewJSONHandler(os.Stdout, nil))
h := RegisterServer(server,
WithEndpoints(endpoints),
h := RegisterServer(server, endpoints,
WithDecoder(decoder),
WithFallbackLogger(logger),
)