MCPcopy Create free account
hub / github.com/netlify/gotrue / loadInstance

Method loadInstance

api/instance.go:15–31  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

13)
14
15func (a *API) loadInstance(w http.ResponseWriter, r *http.Request) (context.Context, error) {
16 instanceID, err := uuid.FromString(chi.URLParam(r, "instance_id"))
17 if err != nil {
18 return nil, badRequestError("Invalid instance ID")
19 }
20 logEntrySetField(r, "instance_id", instanceID)
21
22 i, err := models.GetInstance(a.db, instanceID)
23 if err != nil {
24 if models.IsNotFoundError(err) {
25 return nil, notFoundError("Instance not found")
26 }
27 return nil, internalServerError("Database error loading instance").WithInternalError(err)
28 }
29
30 return withInstance(r.Context(), i), nil
31}
32
33func (a *API) GetAppManifest(w http.ResponseWriter, r *http.Request) error {
34 // TODO update to real manifest

Callers

nothing calls this directly

Calls 8

GetInstanceFunction · 0.92
IsNotFoundErrorFunction · 0.92
badRequestErrorFunction · 0.85
logEntrySetFieldFunction · 0.85
notFoundErrorFunction · 0.85
internalServerErrorFunction · 0.85
withInstanceFunction · 0.85
WithInternalErrorMethod · 0.45

Tested by

no test coverage detected