Expand description
Finding the object stores this machine can already read, and listing what is in them.
datui could open a gs:// or s3:// URL long before this module existed, but only
if you already knew the URL and typed it. That is a poor fit for how object storage
is actually used: the bucket names live in somebody’s head, or in a console tab, and
the thing you want on a home screen is the same thing you want for a local
directory — a list of what is there.
Two rules shape everything here.
Never list a provider datui cannot then read. Discovery deliberately looks at
exactly the credentials object_store will use when the file is opened, and nowhere
else. It would be easy to enumerate buckets through gcloud, which is authenticated
on most developer machines when nothing else is, and the result would be a screen of
buckets that every Enter fails on. A provider that is invisible because its
credentials are missing is a smaller problem than one that lies.
Nothing here runs on the thread that draws. Every function that touches the
network is async and is driven from a worker, the same arrangement remote
filesystem roots use. A bucket list is a network round trip, and a round trip on the
event thread is a frozen interface.
Structs§
- Environment
- Everything discovery is allowed to look at, gathered in one place so it can be supplied verbatim by a test.
- Instance
Identity - Which clouds’ VM or platform identity may be used. Finding one is a request to a
metadata service that hangs on some networks, so it is only made when the config
asks, or where the platform itself says it is there:
K_SERVICEon Cloud Run and Cloud Functions,IDENTITY_ENDPOINTorMSI_ENDPOINTon Azure App Service, Functions and Container Apps. ECS and EKS need neither: they are found by their own variables. - Level
- What one level of a place listed.
- Listed
- A source’s first level, as the home screen lists it: buckets for S3 and Google Cloud, storage accounts for Azure.
- Provider
- An object store datui believes it can read, and why it believes that.
- Watch
- How a listing is watched while it runs.
Enums§
- Provider
Kind - Which API a provider speaks. Not which company runs it: MinIO, Ceph, R2 and AWS
itself are all
ProviderKind::S3, and are told apart by their endpoint.
Constants§
- MAX_
LEVEL_ ROWS - The most rows one level of a bucket lists, as for a local directory: past it the listing stops and says so. A prefix of 141,000 partitions is otherwise 141 requests and every one of them held in memory before the first row is drawn.
Functions§
- adc_
path - The application default credentials file, where
object_storereads it:%APPDATA%\gcloud\on Windows,$HOME/.config/gcloud/elsewhere. Kept in step withobject_store::gcpdeliberately: discovery must agree with the code that will later do the opening, and looking under the home directory on Windows found nothing. - detect
- Object stores this machine can read, in the order they should appear.
- gcs_
next_ page_ token - The
pageTokenfor the next page of a bucket list, when the response has one. - instance_
identity - is_
empty_ marker - An empty object with no extension: a marker some tool left for a folder, whether or
not the directory still has anything in it (
yellow/year=2032beside noyear=2032/). Nothing datui opens is both empty and nameless. - is_
marker - A key that stands for something other than data a user could open: the receipts a job leaves behind, and the marker some tools write in place of a folder.
- is_
refusal - Whether an error is the service refusing the request, rather than failing to answer.
- list_
account - The containers of one account in an Azure source, as rows to step into.
- list_
buckets - Every bucket the provider’s credentials can see.
- list_
first_ level - Everything at the top of a source.
- list_
objects - One level of a bucket or prefix, as home-screen rows, up to
MAX_LEVEL_ROWS. - list_
objects_ watched list_objects, a page at a time:watchsees the rows as they come and can stop the listing between pages.- look_
at_ listing - The kind and what the listing found, as
crate::discover::look_at_directorygives them for a local directory. A prefix’s row is labelled from the second. - narrowing_
prefix - The server-side prefix a home filter can ask a cut-short level for, or
Nonewhen it cannot ask for one. - object_
path - The object_store path for a key as the service stores it.
- pager_
for_ bucket store_for_bucket, as the store that lists a page at a time.- parse_
gcs_ buckets - Bucket names from a Google Cloud Storage
storage/v1/bresponse. - parse_
s3_ buckets - Bucket names from an S3
ListBucketsresponse. - peek_
kind - What a cloud directory holds, from the first page of a delimited listing of it:
Hivewhen its children arekey=valuepartitions,MultiFilewhen they are Parquet files, elseDirectory. One request; nothing is read from any object. - probe_
unsigned - Whether the place
resolvedpoints at can be read with no signature:Some(true)when an unsigned request succeeds,Some(false)when it is refused,Nonewhen the answer says neither (no network, a missing object, a custom endpoint). - s3_
bucket_ region - Where Amazon S3 keeps
bucket, from thex-amz-bucket-regionheader S3 sends with no credentials, whatever the status. Asked once per bucket per session, andNonewhen S3 does not say. - s3_
builder - The S3 builder datui uses everywhere, so that every path authenticates identically.
- split_
bucket_ url - Split a
gs://ors3://URL into its bucket and the prefix inside it. - store_
for_ bucket - An object store for a bucket, with no key.
- unreadable_
google_ login - The credential type of a Google login object_store cannot read, when that is what the environment or the application-default file holds: workload identity federation, an impersonated service account.
Type Aliases§
- Progress
- What a listing hands the rows it has so far.