mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
swarm/storage/localstore: add godoc package overview
This commit is contained in:
parent
015d9775d4
commit
abbb4a6f19
1 changed files with 49 additions and 0 deletions
49
swarm/storage/localstore/doc.go
Normal file
49
swarm/storage/localstore/doc.go
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
// Copyright 2019 The go-ethereum Authors
|
||||||
|
// This file is part of the go-ethereum library.
|
||||||
|
//
|
||||||
|
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
/*
|
||||||
|
Package localstore provides disk storage layer for Swarm Chunk persistance.
|
||||||
|
It uses swarm/shed abstractions on top of github.com/syndtr/goleveldb LevelDB
|
||||||
|
implementation.
|
||||||
|
|
||||||
|
The main type is DB which manages the storage by providing methods to
|
||||||
|
access and add Chunks and to manage their status.
|
||||||
|
|
||||||
|
Modes are abstractions that do specific changes to Chunks. There are three
|
||||||
|
mode types:
|
||||||
|
|
||||||
|
- ModeGet, for Chunk access
|
||||||
|
- ModePut, for adding Chunks to the database
|
||||||
|
- ModeSet, for changing Chunk statuses
|
||||||
|
|
||||||
|
Every mode type has a corresponding type (Getter, Putter and Setter)
|
||||||
|
that provides adequate method to perform the opperation and that type
|
||||||
|
should be injected into localstore consumers instead the whole DB.
|
||||||
|
This provides more clear insight which operations consumer is performing
|
||||||
|
on the database.
|
||||||
|
|
||||||
|
Getters, Putters and Setters accept different get, put and set modes
|
||||||
|
to perform different actions. For example, ModeGet has two different
|
||||||
|
variables ModeGetRequest and ModeGetSync and dwo different Getters
|
||||||
|
can be constructed with them that are used when the chunk is requested
|
||||||
|
or when the chunk is synced as this two events are differently changing
|
||||||
|
the database.
|
||||||
|
|
||||||
|
Subscription methods are implemented for a specific purpose of
|
||||||
|
continuous iterations over Chunks that should be provided to
|
||||||
|
Push and Pull syncing.
|
||||||
|
*/
|
||||||
|
package localstore
|
||||||
Loading…
Reference in a new issue