MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / common_docker_get_token

Function common_docker_get_token

common/download.cpp:821–839  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

819//
820
821static std::string common_docker_get_token(const std::string & repo) {
822 std::string url = "https://auth.docker.io/token?service=registry.docker.io&scope=repository:" + repo + ":pull";
823
824 common_remote_params params;
825 auto res = common_remote_get_content(url, params);
826
827 if (res.first != 200) {
828 throw std::runtime_error("Failed to get Docker registry token, HTTP code: " + std::to_string(res.first));
829 }
830
831 std::string response_str(res.second.begin(), res.second.end());
832 nlohmann::ordered_json response = nlohmann::ordered_json::parse(response_str);
833
834 if (!response.contains("token")) {
835 throw std::runtime_error("Docker registry token response missing 'token' field");
836 }
837
838 return response["token"].get<std::string>();
839}
840
841std::string common_docker_resolve_model(const std::string & docker) {
842 // Parse ai/smollm2:135M-Q4_0

Callers 1

Calls 5

endMethod · 0.80
containsMethod · 0.80
to_stringFunction · 0.50
beginMethod · 0.45

Tested by

no test coverage detected