MCPcopy Create free account
hub / github.com/cloudwan/gohan / fillInContext

Function fillInContext

server/api.go:186–208  ·  view source on GitHub ↗
(context middleware.Context, db db.DB,
	r *http.Request, w http.ResponseWriter,
	s *schema.Schema, p martini.Params, sync sync.Sync,
	identityService middleware.IdentityService,
	queue *job.Queue, requestData map[string]interface{})

Source from the content-addressed store, hash-verified

184}
185
186func fillInContext(context middleware.Context, db db.DB,
187 r *http.Request, w http.ResponseWriter,
188 s *schema.Schema, p martini.Params, sync sync.Sync,
189 identityService middleware.IdentityService,
190 queue *job.Queue, requestData map[string]interface{}) {
191 context["path"] = r.URL.Path
192 context["http_request"] = r
193 context["http_response"] = w
194 context["request_data"] = deepcopy.Copy(requestData).(map[string]interface{})
195 context["schema"] = s
196 context["schema_id"] = s.ID
197 params := map[string]interface{}{}
198 for key, value := range p {
199 params[key] = value
200 }
201 context["params"] = params
202 context["sync"] = sync
203 context["db"] = db
204 context["queue"] = queue
205 context["identity_service"] = identityService
206 context["service_auth"], _ = identityService.GetServiceAuthorization()
207 context["openstack_client"] = identityService.GetClient()
208}
209
210//MapRouteBySchema setup api route by schema
211func MapRouteBySchema(server *Server, dataStore db.DB, s *schema.Schema) {

Callers 1

MapRouteBySchemaFunction · 0.70

Calls 3

CopyMethod · 0.65
GetClientMethod · 0.65

Tested by

no test coverage detected