Documentation
¶
Index ¶
- type FSStore
- func (s *FSStore) AppendHistory(user, slug, cidStr string) error
- func (s *FSStore) EnsureUserContainer(user string) error
- func (s *FSStore) ObjectPath(cid string) string
- func (s *FSStore) ReadCanonical(cid string) ([]byte, error)
- func (s *FSStore) ReadHistory(user, slug string) ([]HistoryEntry, error)
- func (s *FSStore) ReadLatest(user, slug string) (string, error)
- func (s *FSStore) ReadObject(cid string) ([]byte, error)
- func (s *FSStore) ReadSignature(cid string) (*SignatureMetadata, error)
- func (s *FSStore) SaveIdentity(githubID string, doc []byte) error
- func (s *FSStore) SaveObject(cid string, raw []byte, canonical []byte) error
- func (s *FSStore) SaveSignature(cid, signature, signerAddr string, usePersonalSign bool) error
- func (s *FSStore) SignaturePath(cid string) string
- func (s *FSStore) UpdateLatest(user, slug, cid string) error
- type HistoryEntry
- type SignatureMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FSStore ¶
type FSStore struct {
// contains filtered or unexported fields
}
FSStore is a simple file-system-backed store for sealed objects and user containers. Structure:
{base}/o/{cid} -> original JSON-LD bytes
{base}/o/canonical/{cid}.nq -> canonical n-quads text
{base}/u/{login}/g/{slug}/latest -> text file containing CID
{base}/u/{login}/g/{slug}/_history -> JSON array of history entries
func NewFSStore ¶
func (*FSStore) AppendHistory ¶
AppendHistory appends a history entry (CID + timestamp) to _history (JSON array).
func (*FSStore) EnsureUserContainer ¶
Utility: Create container for user (e.g., when user logs in)
func (*FSStore) ObjectPath ¶
ObjectPath returns the path where the original JSON-LD for a CID is stored.
func (*FSStore) ReadCanonical ¶
Utility: Read canonical n-quads for a cid
func (*FSStore) ReadHistory ¶
func (s *FSStore) ReadHistory(user, slug string) ([]HistoryEntry, error)
ReadHistory reads and returns the history entries for a gist.
func (*FSStore) ReadLatest ¶
ReadLatest returns the CID stored in latest (or empty string if not present).
func (*FSStore) ReadObject ¶
Utility: Read object raw JSON-LD
func (*FSStore) ReadSignature ¶
func (s *FSStore) ReadSignature(cid string) (*SignatureMetadata, error)
ReadSignature reads signature metadata for a CID.
func (*FSStore) SaveIdentity ¶
Utility: Save identity doc at /id/github:{id}
func (*FSStore) SaveObject ¶
SaveObject writes the raw JSON-LD and canonical bytes to disk. It injects the computed CID as the @id field into the stored JSON-LD.
func (*FSStore) SaveSignature ¶
SaveSignature writes signature metadata to disk.
func (*FSStore) SignaturePath ¶
SignaturePath returns the path where the signature metadata for a CID is stored.
func (*FSStore) UpdateLatest ¶
UpdateLatest writes the pointer file /u/{login}/g/{slug}/latest containing the CID.
type HistoryEntry ¶
type SignatureMetadata ¶
type SignatureMetadata struct {
Signature string `json:"signature"`
SignerAddress string `json:"signerAddress"`
UsePersonalSign bool `json:"usePersonalSign"`
}
SignatureMetadata holds information about a signature.