aboutsummaryrefslogtreecommitdiff
path: root/pkg/client/api/api.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/client/api/api.go')
-rw-r--r--pkg/client/api/api.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/pkg/client/api/api.go b/pkg/client/api/api.go
new file mode 100644
index 0000000..d773bcc
--- /dev/null
+++ b/pkg/client/api/api.go
@@ -0,0 +1,22 @@
+// package api implements the Sigsum v0 API. See
+//
+// https://git.sigsum.org/sigsum/tree/doc/api.md
+//
+// for further details. No verification, retries, etc., is done here.
+package api
+
+import (
+ "git.sigsum.org/sigsum-lib-go/pkg/requests"
+ "git.sigsum.org/sigsum-lib-go/pkg/types"
+)
+
+type API interface {
+ GetToCosignTreeHead() (*types.SignedTreeHead, error)
+ GetCosignedTreeHead() (*types.CosignedTreeHead, error)
+ GetInclusionProof(treeSize uint64, leafHash *types.Hash) (*types.InclusionProof, error)
+ GetConsistencyProof(oldSize, newSize uint64) (*types.ConsistencyProof, error)
+ GetLeaves(startSize, endSize uint64) (*types.Leaves, error)
+
+ AddLeaf(*requests.Leaf) error
+ AddCosignature(*requests.Cosignature) error
+}