New Datastore Interfaces
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Non vengono indicati file né test. Inizia esaminando le interfacce go-datastore esistenti, quindi confronta i design proposti per StreamingDatastore, ReadClosurer e OutParamer e la discussione precedente in #28; l'attività è completata quando è stato deciso un design dell'interfaccia e l'ambito è stato concordato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The interfaces in go-datastore have been needing updating for a while. This came up in #28 so i decided to start the conversation up. Lets collect all these ideas together here so we can move forward with this.
Interface additions i've been looking for involve streaming interfaces:
type StreamingDatastore interface {
// GetR returns a reader to read the value directly from the source (sans buffering)
GetR(k ds.Key) (io.Reader, error)
// PutW returns a new put writer that can be used to stream a value
// into the datastore
PutW() (WritePutter, error)
}
// WritePutter is used to stream values into the datastore. Since the caller may not
// know the key they want to store this value as until the write is complete (content
// addressing) the key is set after the write is complete
type WritePutter interface{
io.Writer
FinishWithKey(k ds.Key) error
}
Also, for queries and maybe 'gets' in general, it would be nice to have a readonly view interface. Many storage backends (bolt in particular) allow you to read and operate on the data within the datastore without making a copy (i.e. using the datastores memory) within a closure. This would be really useful for things like 'load this protobuf object from disk' where we don't need our own copy of the bytes.
// A datastore implementing ReadClosurer allows passing a closure to operate
// on a readonly view of the data in question
type ReadClosurer interface {
GetFunc(k ds.Key, func(i interface{}) error) error
}
Alternatively, this could be done with an output parameter and interfaces:
type OutParamer interface{
GetOut(k ds.Key, out DSUnmarshaler) error
}
type DSUnmarshaler interface {
DSUnmarshal(val []byte) error
}
This would behave similarly to the json.Unmarshaler interfaces.
- Lingua principale
- Go
- Stelle
- 248
- Fork
- 68
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ipfs/go-datastore
-
exp/novice help wanted kind/enhancement status/ready
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
ipfs/go-datastore#160 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
ipfs/go-datastore#139 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
ipfs/go-datastore#116 · 31 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 30/100
ipfs/go-datastore#102 · 5 commenti ·
-
Add ceph rados datastoreAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
ipfs/go-datastore#101 · 4 commenti · 1 reazione ·
Tutte le issue di ipfs/go-datastore
Issue simili
-
area/networking kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
siderolabs/talos#14972 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
kubectl wait outputs cryptic "error: unrecognized condition: []" when --for is omittedForse già presa @muskan-creates352 l’ha presa oggi. Apertakind/bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
kubernetes/kubectl#1910 · 1 commento ·
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
stacklok/toolhive-catalog#1967 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
unbound-force/gaze#353 ·
I maintainer di solito rispondono entro 1 giorno