Documentation
¶
Index ¶
- Constants
- Variables
- func GetCBORHandle() (h *codec.CborHandle)
- type BinRefExt
- type BinaryRef
- func (ref BinaryRef) GetRef(t RefType) (refs.Ref, error)
- func (ref BinaryRef) MarshalBinary() ([]byte, error)
- func (ref BinaryRef) MarshalJSON() ([]byte, error)
- func (ref BinaryRef) MarshalText() ([]byte, error)
- func (ref BinaryRef) Sigil() string
- func (ref *BinaryRef) Size() int
- func (ref BinaryRef) URI() string
- func (ref *BinaryRef) UnmarshalBinary(data []byte) error
- func (ref *BinaryRef) UnmarshalJSON(data []byte) error
- func (ref *BinaryRef) UnmarshalText(data []byte) error
- type Content
- type ContentRef
- func (ref ContentRef) Algo() refs.RefAlgo
- func (ref ContentRef) MarshalBinary() ([]byte, error)
- func (ref ContentRef) MarshalText() ([]byte, error)
- func (ref ContentRef) ShortRef() string
- func (ref ContentRef) ShortSigil() string
- func (ref ContentRef) Sigil() string
- func (ref ContentRef) String() string
- func (ref ContentRef) URI() string
- func (ref *ContentRef) UnmarshalBinary(data []byte) error
- type ContentType
- type Encoder
- type Event
- type RefType
- type Transfer
- func (tr *Transfer) Author() refs.FeedRef
- func (tr *Transfer) Claimed() time.Time
- func (tr *Transfer) ContentBytes() []byte
- func (tr Transfer) Key() refs.MessageRef
- func (tr Transfer) MarshalCBOR() ([]byte, error)
- func (tr *Transfer) Previous() *refs.MessageRef
- func (tr *Transfer) Received() time.Time
- func (tr *Transfer) Seq() int64
- func (tr *Transfer) UnmarshalCBOR(data []byte) error
- func (tr *Transfer) UnmarshaledEvent() (*Event, error)
- func (tr *Transfer) ValueContent() *ssb.Value
- func (tr *Transfer) ValueContentJSON() json.RawMessage
- func (tr *Transfer) Verify(hmacKey *[32]byte) bool
Constants ¶
View Source
const CypherLinkCBORTag = 1050
CypherLinkCBORTag is the CBOR tag for a (ssb) cypherlink from https://www.iana.org/assignments/cbor-tags/cbor-tags.xhtml#tags 888 is WIP and currently unused
Variables ¶
View Source
var (
RefAlgoContentGabby refs.RefAlgo = "gabby-v1-content"
)
Functions ¶
func GetCBORHandle ¶
func GetCBORHandle() (h *codec.CborHandle)
GetCBORHandle returns a codec.CborHandle with an extension yet to be registerd for SSB References as CBOR tag XXX
Types ¶
type BinRefExt ¶
type BinRefExt struct{}
func (BinRefExt) ConvertExt ¶
func (x BinRefExt) ConvertExt(v interface{}) interface{}
type BinaryRef ¶
type BinaryRef struct {
// contains filtered or unexported fields
}
BinaryRef defines a binary representation for feed, message, and content references
func (BinaryRef) MarshalBinary ¶
func (BinaryRef) MarshalJSON ¶
func (BinaryRef) MarshalText ¶ added in v0.2.1
func (*BinaryRef) UnmarshalBinary ¶
func (*BinaryRef) UnmarshalJSON ¶
func (*BinaryRef) UnmarshalText ¶ added in v0.2.1
type Content ¶
type Content struct { Hash BinaryRef Size uint16 Type ContentType }
type ContentRef ¶ added in v0.2.0
type ContentRef struct {
// contains filtered or unexported fields
}
ContentRef defines the hashed content of a message
func NewContentRefFromBytes ¶ added in v0.2.0
func NewContentRefFromBytes(b []byte) (ContentRef, error)
func (ContentRef) Algo ¶ added in v0.2.0
func (ref ContentRef) Algo() refs.RefAlgo
func (ContentRef) MarshalBinary ¶ added in v0.2.0
func (ref ContentRef) MarshalBinary() ([]byte, error)
func (ContentRef) MarshalText ¶ added in v0.2.1
func (ref ContentRef) MarshalText() ([]byte, error)
func (ContentRef) ShortRef ¶ added in v0.2.0
func (ref ContentRef) ShortRef() string
func (ContentRef) ShortSigil ¶ added in v0.2.1
func (ref ContentRef) ShortSigil() string
func (ContentRef) Sigil ¶ added in v0.2.1
func (ref ContentRef) Sigil() string
func (ContentRef) String ¶ added in v0.2.1
func (ref ContentRef) String() string
func (ContentRef) URI ¶ added in v0.2.1
func (ref ContentRef) URI() string
func (*ContentRef) UnmarshalBinary ¶ added in v0.2.0
func (ref *ContentRef) UnmarshalBinary(data []byte) error
type ContentType ¶
type ContentType uint
const ( ContentTypeArbitrary ContentType = iota ContentTypeJSON ContentTypeCBOR )
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoder ¶
func NewEncoder(author ed25519.PrivateKey) *Encoder
func (*Encoder) WithNowTimestamps ¶ added in v0.1.1
type Event ¶
type Event struct { Previous *BinaryRef // %... Metadata hashsha Author BinaryRef Sequence uint64 Timestamp int64 Content Content }
func (Event) MarshalCBOR ¶
func (*Event) UnmarshalCBOR ¶
type Transfer ¶
type Transfer struct { Event []byte Signature []byte Content []byte // contains filtered or unexported fields }
func (*Transfer) ContentBytes ¶
func (Transfer) Key ¶
func (tr Transfer) Key() refs.MessageRef
func (Transfer) MarshalCBOR ¶
func (*Transfer) Previous ¶
func (tr *Transfer) Previous() *refs.MessageRef
func (*Transfer) UnmarshalCBOR ¶
func (*Transfer) UnmarshaledEvent ¶
func (*Transfer) ValueContent ¶
ValueContent returns a ssb.Value that can be represented as JSON. Note that it's signature is useless for verification in this form. Get the whole transfer message and use tr.Verify()
func (*Transfer) ValueContentJSON ¶
func (tr *Transfer) ValueContentJSON() json.RawMessage
Click to show internal directories.
Click to hide internal directories.