From 0cab7e355b943235bc5ffbf1d4ceaeb272041729 Mon Sep 17 00:00:00 2001 From: Jono Yang Date: Fri, 31 May 2024 18:11:12 -0700 Subject: [PATCH] Add documentation for to_purl and from_purl #241 #445 Signed-off-by: Jono Yang --- docs/source/purldb/api.rst | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/source/purldb/api.rst b/docs/source/purldb/api.rst index 8e5fef30..d6aef4f5 100644 --- a/docs/source/purldb/api.rst +++ b/docs/source/purldb/api.rst @@ -1071,3 +1071,32 @@ Return a list of package sets and the package data of packages within ... ] } + + +to_purl +------- + +Return a ``golang_purl`` PackageURL from ``go_package``, a standard go import +string or a go.mod string. + +``GET /api/to_purl/?go_package=github.com/gorilla/mux%20v1.8.1`` + +.. code-block:: json + + { + "golang_purl": "pkg:golang/github.com/gorilla/mux@v1.8.1" + } + + +from_purl +--------- + +Return a ``git_repo`` from a standard PackageURL ``package_url``. + +``GET /api/from_purl/?package_url=pkg:github/ckeditor/ckeditor4-react`` + +.. code-block:: json + + { + "git_repo": "git+https://github.com/ckeditor/ckeditor4-react.git" + }