-
Notifications
You must be signed in to change notification settings - Fork 14
/
requestrouter.go
56 lines (46 loc) · 1.37 KB
/
requestrouter.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Code generated by sysl DO NOT EDIT.
package deps
import (
"context"
"net/http"
"github.com/anz-bank/sysl-go/core"
"github.com/anz-bank/sysl-go/handlerinitialiser"
"github.com/go-chi/chi"
)
// Router interface for Deps
type Router interface {
Route(router *chi.Mux)
}
// ServiceRouter for Deps API
type ServiceRouter struct {
gc core.RestGenCallback
svcHandler *ServiceHandler
basePathFromSpec string
}
// swaggerFile is a struct to store the swagger file system
type swaggerFile struct {
file http.FileSystem
}
// swagger will receive the embedded swagger file if it is generated by the resource application
var swagger = swaggerFile{}
// NewServiceRouter creates a new service router for Deps
func NewServiceRouter(gc core.RestGenCallback, svcHandler *ServiceHandler) handlerinitialiser.HandlerInitialiser {
return &ServiceRouter{gc, svcHandler, "/deps"}
}
// WireRoutes ...
//nolint:funlen
func (s *ServiceRouter) WireRoutes(ctx context.Context, r chi.Router) {
r.Route(core.SelectBasePath(s.basePathFromSpec, s.gc.BasePath()), func(r chi.Router) {
s.gc.AddMiddleware(ctx, r)
r.Get("/api-docs", s.svcHandler.GetApiDocsListHandler)
r.Get("/success", s.svcHandler.GetSuccessListHandler)
})
}
// Config ...
func (s *ServiceRouter) Config() interface{} {
return s.gc.Config()
}
// Name ...
func (s *ServiceRouter) Name() string {
return "Deps"
}