Skip to content

Commit

Permalink
Renamed config to discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Apr 26, 2023
1 parent dfbc6b2 commit f928823
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ type resourceTypes struct {
Protocols map[string]string `json:"protocols"`
}

type configHandler struct {
type discoHandler struct {
c configData
}

func (h *configHandler) init(c *config) {
func (h *discoHandler) init(c *config) {
h.c = c.Config
h.c.Enabled = true
h.c.APIVersion = "1.1.0"
Expand Down Expand Up @@ -77,7 +77,7 @@ func (h *configHandler) init(c *config) {
}

// Send sends the configuration to the caller.
func (h *configHandler) Send(w http.ResponseWriter, r *http.Request) {
func (h *discoHandler) Send(w http.ResponseWriter, r *http.Request) {
log := appctx.GetLogger(r.Context())

w.Header().Set("Content-Type", "application/json")
Expand Down
6 changes: 3 additions & 3 deletions internal/http/services/ocmd/ocm.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ func New(m map[string]interface{}, log *zerolog.Logger) (global.Service, error)
}

func (s *svc) routerInit() error {
configHandler := new(configHandler)
discoHandler := new(discoHandler)
sharesHandler := new(sharesHandler)
notificationsHandler := new(notificationsHandler)
invitesHandler := new(invitesHandler)

configHandler.init(s.Conf)
discoHandler.init(s.Conf)
if err := sharesHandler.init(s.Conf); err != nil {
return err
}
Expand All @@ -94,7 +94,7 @@ func (s *svc) routerInit() error {
return err
}

s.router.Get("/ocm-provider", configHandler.Send)
s.router.Get("/ocm-provider", discoHandler.Send)
s.router.Post("/shares", sharesHandler.CreateShare)
s.router.Post("/notifications", notificationsHandler.SendNotification)
s.router.Post("/invite-accepted", invitesHandler.AcceptInvite)
Expand Down

0 comments on commit f928823

Please sign in to comment.