doc and few design adjustments

pull/19/head
Niko PLP 7 months ago
parent ea4b203b16
commit fe4a41b3c2
  1. 6
      ng-net/src/types.rs
  2. 1
      ng-repo/src/store.rs
  3. 3
      ng-repo/src/types.rs
  4. 2
      ng-verifier/src/commits/mod.rs
  5. 2
      ng-verifier/src/site.rs
  6. 25
      ng-verifier/src/types.rs
  7. 2
      ng-verifier/src/user_storage/mod.rs

@ -1303,9 +1303,11 @@ pub struct InnerOverlayLink {
/// Details of the overlay of an NgLink /// Details of the overlay of an NgLink
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)]
pub enum OverlayLink { pub enum OverlayLink {
Outer(StoreOverlay), Outer(Digest),
Inner(InnerOverlayLink), InnerLink(InnerOverlayLink),
Inner(Digest),
Inherit, Inherit,
Public(PubKey),
} }
/// Overlay session ID /// Overlay session ID

@ -29,6 +29,7 @@ use threshold_crypto::{SecretKeySet, SecretKeyShare};
pub struct Store { pub struct Store {
store_repo: StoreRepo, store_repo: StoreRepo,
//TODO: store_readcap and store_overlay_branch_readcap could be empty, if we have only an outer access to the store. should be Options
store_readcap: ReadCap, store_readcap: ReadCap,
store_overlay_branch_readcap: ReadCap, store_overlay_branch_readcap: ReadCap,
pub overlay_id: OverlayId, pub overlay_id: OverlayId,

@ -1579,7 +1579,6 @@ impl RemovePermission {
pub enum RepoNamedItemV0 { pub enum RepoNamedItemV0 {
Branch(BranchId), Branch(BranchId),
Commit(ObjectId), Commit(ObjectId),
File(ObjectId),
} }
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
@ -1587,7 +1586,7 @@ pub enum RepoNamedItem {
V0(RepoNamedItemV0), V0(RepoNamedItemV0),
} }
/// Add a new name in the repo that can point to a branch, a commit or a file /// Add a new name in the repo that can point to a branch or a commit
/// ///
/// Or change the value of a name /// Or change the value of a name
/// DEPS: if it is a change of value: all the previous AddName commits seen for this name /// DEPS: if it is a change of value: all the previous AddName commits seen for this name

@ -7,6 +7,8 @@
// notice may not be copied, modified, or distributed except // notice may not be copied, modified, or distributed except
// according to those terms. // according to those terms.
//! Verifiers for each Commit type
use crate::verifier::Verifier; use crate::verifier::Verifier;
use ng_repo::errors::VerifierError; use ng_repo::errors::VerifierError;
use ng_repo::log::*; use ng_repo::log::*;

@ -9,7 +9,7 @@
* according to those terms. * according to those terms.
*/ */
//! Site (Public, Protected, Private) of Individual and Org //! A Site of an Individual or Org (with 3P stores: Public, Protected, Private)
use crate::types::*; use crate::types::*;
use crate::verifier::Verifier; use crate::verifier::Verifier;

@ -161,8 +161,11 @@ pub type CancelFn = Box<dyn FnOnce()>;
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
pub enum AppFetchContentV0 { pub enum AppFetchContentV0 {
Get, // more to be detailed Get, // more to be detailed
Subscribe,
Update,
ReadQuery, // more to be detailed ReadQuery, // more to be detailed
WriteQuery, // more to be detailed WriteQuery, // more to be detailed
//Invoke,
} }
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
@ -203,13 +206,14 @@ pub enum AppRequest {
} }
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
pub enum AppQuery { pub enum DocQuery {
V0(String), // Sparql V0(String), // Sparql
} }
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GraphUpdate { pub struct GraphUpdate {
sparql_update: String, add: Vec<String>,
remove: Vec<String>,
} }
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
@ -227,30 +231,31 @@ pub enum DiscreteUpdate {
} }
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
pub struct AppUpdate { pub struct DocUpdate {
heads: Vec<ObjectId>, heads: Vec<ObjectId>,
graph: Option<GraphUpdate>, graph: Option<GraphUpdate>,
discrete: Option<DiscreteUpdate>, discrete: Option<DiscreteUpdate>,
} }
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
pub struct AppCreate { pub struct DocCreate {
store: StoreRepo, store: StoreRepo,
content_type: BranchContentType, content_type: BranchContentType,
} }
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
pub struct AppDelete { pub struct DocDelete {
/// Nuri of doc to delete /// Nuri of doc to delete
nuri: String, nuri: String,
} }
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
pub enum AppRequestPayloadV0 { pub enum AppRequestPayloadV0 {
Create(AppCreate), Create(DocCreate),
Query(AppQuery), Query(DocQuery),
Update(AppUpdate), Update(DocUpdate),
Delete(AppDelete), Delete(DocDelete),
//Invoke(InvokeArguments),
SmallFilePut(SmallFile), SmallFilePut(SmallFile),
RandomAccessFilePut(String), // content_type RandomAccessFilePut(String), // content_type
RandomAccessFilePutChunk((ObjectId, serde_bytes::ByteBuf)), // end the upload with an empty vec RandomAccessFilePutChunk((ObjectId, serde_bytes::ByteBuf)), // end the upload with an empty vec
@ -277,7 +282,7 @@ pub enum DiscretePatch {
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GraphPatch { pub struct GraphPatch {
/// oxigraph::model::GroundQuad serialized in turtle with oxrdfio /// oxigraph::model::GroundQuad serialized to n-quads with oxrdfio
pub adds: Vec<String>, pub adds: Vec<String>,
pub removes: Vec<String>, pub removes: Vec<String>,
} }

@ -7,6 +7,8 @@
// notice may not be copied, modified, or distributed except // notice may not be copied, modified, or distributed except
// according to those terms. // according to those terms.
//! Storage of user application data (RDF, rich-text, JSON, etc) and helper objects for mapping to KCV
pub mod storage; pub mod storage;
pub use storage::*; pub use storage::*;

Loading…
Cancel
Save