Documentation ¶
Index ¶
- Constants
- type AppendOptions
- type CreateEntryOptions
- type EntrySortFn
- type ExcludeFunc
- type FetchOptions
- type Hashable
- type IO
- type IOPreSign
- type IPFSLog
- type IPFSLogEntry
- type IPFSLogLamportClock
- type IPFSLogOrderedEntries
- type IteratorOptions
- type JSONLog
- type LogOptions
- type Snapshot
- type WriteOpts
Constants ¶
View Source
const KeyEncryptedLinks = "encrypted_links"
View Source
const KeyEncryptedLinksNonce = "encrypted_links_nonce"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppendOptions ¶ added in v1.1.0
type CreateEntryOptions ¶ added in v1.1.0
type EntrySortFn ¶ added in v1.1.0
type EntrySortFn func(IPFSLogEntry, IPFSLogEntry) (int, error)
type ExcludeFunc ¶ added in v1.7.0
type ExcludeFunc func(hash cid.Cid) bool
type FetchOptions ¶
type FetchOptions struct { Length *int ShouldExclude ExcludeFunc Exclude []IPFSLogEntry Concurrency int Timeout time.Duration // @FIXME(gfanton): progress chan is close automatically by IpfsLog ProgressChan chan IPFSLogEntry Provider identityprovider.Interface IO IO }
type IO ¶ added in v1.3.0
type IO interface { Write(ctx context.Context, ipfs coreiface.CoreAPI, obj interface{}, opts *WriteOpts) (cid.Cid, error) Read(ctx context.Context, ipfs coreiface.CoreAPI, contentIdentifier cid.Cid) (format.Node, error) DecodeRawEntry(node format.Node, hash cid.Cid, p identityprovider.Interface) (IPFSLogEntry, error) DecodeRawJSONLog(node format.Node) (*JSONLog, error) }
type IOPreSign ¶ added in v1.3.0
type IOPreSign interface { IO PreSign(entry IPFSLogEntry) (IPFSLogEntry, error) }
type IPFSLog ¶
type IPFSLog interface { GetID() string Append(ctx context.Context, payload []byte, opts *AppendOptions) (IPFSLogEntry, error) Iterator(options *IteratorOptions, output chan<- IPFSLogEntry) error Join(otherLog IPFSLog, size int) (IPFSLog, error) ToString(payloadMapper func(IPFSLogEntry) string) string ToSnapshot() *Snapshot ToMultihash(ctx context.Context) (cid.Cid, error) Values() IPFSLogOrderedEntries ToJSONLog() *JSONLog Heads() IPFSLogOrderedEntries GetEntries() IPFSLogOrderedEntries RawHeads() IPFSLogOrderedEntries SetIdentity(identity *identityprovider.Identity) IO() IO Len() int Get(c cid.Cid) (IPFSLogEntry, bool) }
type IPFSLogEntry ¶
type IPFSLogEntry interface { accesscontroller.LogEntry New() IPFSLogEntry Copy() IPFSLogEntry GetLogID() string GetNext() []cid.Cid GetRefs() []cid.Cid GetV() uint64 GetKey() []byte GetSig() []byte GetHash() cid.Cid GetClock() IPFSLogLamportClock GetAdditionalData() map[string]string SetPayload([]byte) SetLogID(string) SetNext([]cid.Cid) SetRefs([]cid.Cid) SetV(uint64) SetKey([]byte) SetSig([]byte) SetIdentity(*identityprovider.Identity) SetHash(cid.Cid) SetClock(IPFSLogLamportClock) SetAdditionalDataValue(key string, value string) IsValid() bool Verify(identity identityprovider.Interface, io IO) error Equals(b IPFSLogEntry) bool IsParent(b IPFSLogEntry) bool Defined() bool }
type IPFSLogLamportClock ¶
type IPFSLogLamportClock interface { New() IPFSLogLamportClock Defined() bool GetID() []byte GetTime() int SetID([]byte) SetTime(int) Tick() IPFSLogLamportClock Merge(clock IPFSLogLamportClock) IPFSLogLamportClock Compare(b IPFSLogLamportClock) int }
type IPFSLogOrderedEntries ¶
type IPFSLogOrderedEntries interface { // Merge will fusion two OrderedMap of entries. Merge(other IPFSLogOrderedEntries) IPFSLogOrderedEntries // Copy creates a copy of an OrderedMap. Copy() IPFSLogOrderedEntries // Get retrieves an Entry using its key. Get(key string) (IPFSLogEntry, bool) // UnsafeGet retrieves an Entry using its key, returns nil if not found. UnsafeGet(key string) IPFSLogEntry // Set defines an Entry in the map for a given key. Set(key string, value IPFSLogEntry) // Slice returns an ordered slice of the values existing in the map. Slice() []IPFSLogEntry // Keys retrieves the ordered list of keys in the map. Keys() []string // Len gets the length of the map. Len() int // At gets an item at the given index in the map, returns nil if not found. At(index uint) IPFSLogEntry Reverse() IPFSLogOrderedEntries }
type IteratorOptions ¶
type IteratorOptions struct { GT cid.Cid GTE cid.Cid LT []cid.Cid LTE []cid.Cid Amount *int }
type LogOptions ¶
type LogOptions struct { ID string AccessController accesscontroller.Interface Entries IPFSLogOrderedEntries Heads []IPFSLogEntry Clock IPFSLogLamportClock SortFn func(a, b IPFSLogEntry) (int, error) Concurrency uint IO IO }
type Snapshot ¶
type Snapshot struct { ID string Heads []cid.Cid Values []IPFSLogEntry Clock IPFSLogLamportClock }
Click to show internal directories.
Click to hide internal directories.