lxd icon indicating copy to clipboard operation
lxd copied to clipboard

Move `lxd/response` to `shared/response`

Open markylaing opened this issue 1 year ago • 0 comments

Many downstream packages are using the lxd/response package. #13252 removed the import of lxd/db from lxd/response so that downstream package can avoid additional imports, but if the package is being used externally it should be moved under shared. This is a little tricky because lxd/response also imports lxd/ucred and lxd/util. lxd/ucred imports lxd/endpoints/listeners and so on. So we'll need to evaluate which utils are specific to LXD and which could be used externally.

Additionally, we can think about moving some nice utils from LXD cloud into the shared package. E.g. the request parser in LXD Cloud provides a clean way to extract request info: https://github.com/canonical/lxd-cloud/blob/main/internal/rest/request/parser.go

After this is done, we should evaluate the imports of e.g. microcluster and microcloud to ensure they are only importing from shared or client.

markylaing avatar Apr 03 '24 11:04 markylaing