Documentation ¶
Index ¶
- Constants
- func Decrypt(key []byte, buf []byte) ([]byte, error)
- func Encrypt(key []byte, buf []byte) ([]byte, error)
- func KeyFromPassphrase(passphrase []byte) ([]byte, []byte)
- func KeyFromPassphraseWithSalt(passphrase []byte, salt []byte) []byte
- func SecretFromPassphrase(passphrase []byte) []byte
- type Auth
- type Block
- type HTTPReader
- type Header
- type Index
- func (index *Index) Mention(mention string, blockChecksum [32]byte)
- func (index *Index) Record(blockLen uint64, blockChecksum [32]byte, blockSignature [64]byte)
- func (index *Index) Reference(ref string, blockChecksum [32]byte)
- func (index *Index) Search(term string) [][]byte
- func (index *Index) Tag(hashtag string, blockChecksum [32]byte)
- func (index *Index) Thread(thread string, blockChecksum [32]byte)
- func (index *Index) ToBytes() []byte
- type Payload
- type StreamReader
- type StreamWriter
- func (stream *StreamWriter) Append(title string, name string, contentType string, data []byte) error
- func (stream *StreamWriter) Commit(pathname string) error
- func (stream *StreamWriter) ID() string
- func (stream *StreamWriter) Name() string
- func (stream *StreamWriter) Verify(block *Block) bool
- func (stream *StreamWriter) Writeable() bool
Constants ¶
View Source
const AuthBlockSize = 236
View Source
const HeaderSize = 170
View Source
const HeaderVersion = 1
Variables ¶
This section is empty.
Functions ¶
func KeyFromPassphrase ¶
func SecretFromPassphrase ¶
Types ¶
type Auth ¶
func NewAuthFromBytes ¶
type Block ¶
type Block struct { CreationTime time.Time Message string Payload []Payload Thread []byte Parent []byte }
func NewBlockFromBytes ¶
type HTTPReader ¶
type HTTPReader struct {
// contains filtered or unexported fields
}
func NewHTTPReader ¶
func NewHTTPReader(url string) (*HTTPReader, error)
func (*HTTPReader) Close ¶
func (hr *HTTPReader) Close() error
type Header ¶
type Header struct { Name [16]byte Version uint16 GenerationTime uint64 IndexOffset uint64 IndexLength uint64 IndexChecksum [32]byte IndexSignature [64]byte PublicKey ed25519.PublicKey }
func NewHeader ¶
func NewHeader(stream *StreamWriter) *Header
func NewHeaderFromBytes ¶
type Index ¶
type Index struct { Records []indexRecord Mentions map[string][][]byte References map[string][][]byte Threads map[string][][]byte }
func NewIndexFromBytes ¶
type StreamReader ¶
type StreamReader struct { Blocks []*Block Index *Index PublicKey *ed25519.PublicKey Signature []byte // contains filtered or unexported fields }
func NewReader ¶
func NewReader(rd io.ReadSeekCloser) (*StreamReader, error)
func NewReaderFromFile ¶
func NewReaderFromFile(pathname string) (*StreamReader, error)
func NewReaderFromURL ¶
func NewReaderFromURL(url string) (*StreamReader, error)
func (*StreamReader) Close ¶
func (stream *StreamReader) Close() error
func (*StreamReader) ID ¶
func (stream *StreamReader) ID() string
func (*StreamReader) Name ¶
func (stream *StreamReader) Name() string
func (*StreamReader) Size ¶
func (stream *StreamReader) Size() uint64
func (*StreamReader) Verify ¶
func (stream *StreamReader) Verify(block *Block) bool
type StreamWriter ¶
type StreamWriter struct { Blocks []*Block Index *Index PublicKey *ed25519.PublicKey Signature []byte // contains filtered or unexported fields }
func (*StreamWriter) Commit ¶
func (stream *StreamWriter) Commit(pathname string) error
func (*StreamWriter) ID ¶
func (stream *StreamWriter) ID() string
func (*StreamWriter) Name ¶
func (stream *StreamWriter) Name() string
func (*StreamWriter) Verify ¶
func (stream *StreamWriter) Verify(block *Block) bool
func (*StreamWriter) Writeable ¶
func (stream *StreamWriter) Writeable() bool
Click to show internal directories.
Click to hide internal directories.