INNER CODE UNIT · Go

GetMinilockID

cryptag/cryptag · servers/keyserver/main.go:45

func GetMinilockID(db *bolt.DB) func(w http.ResponseWriter, req *http.Request) {
	return func(w http.ResponseWriter, req *http.Request) {
		email := mux.Vars(req)["email"]
		mID, err := GetMinilockIDByEmail(db, email)
		if err != nil {
			log.Printf("Error from GetMinilockIDByEmail(%q): %v\n", email, err)
			if err == ErrMinilockIDNotFound {
				writeErrorStatus(w, err.Error(), http.StatusNotFound, err)
				return
			}
			writeError(w, "Error fetching miniLock ID", err)
			return
		}
		ident := &Identity{Email: email, MinilockID: mID}
		api.WriteJSON(w, ident)
		return
	}
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…