Versions in this module Expand all Collapse all v0 v0.2.1 Mar 4, 2015 Changes in this version + const DBlockVersion + const ErrorBadElementSpec + const ErrorBadIdentifier + const ErrorBadMethod + const ErrorBadPOSTData + const ErrorBadVersionSpec + const ErrorBlockNotFound + const ErrorEmptyRequest + const ErrorEntryNotFound + const ErrorHTMLMarshal + const ErrorHTTPDoRequestFailure + const ErrorHTTPNewRequestFailure + const ErrorInternal + const ErrorJSONMarshal + const ErrorJSONUnmarshal + const ErrorMalformedVersionSpec + const ErrorMissingVersionSpec + const ErrorNotAcceptable + const ErrorTemplateError + const ErrorUnsupportedMarshal + const ErrorUnsupportedUnmarshal + const ErrorVerifySignature + const ErrorXMLMarshal + const ErrorXMLUnmarshal + const HashSize + const Separator + const TYPE_BUY + const TYPE_PAY_CHAIN + const TYPE_PAY_ENTRY + var M = struct{ ... } + func AltBlockEncoder(scratch [64]byte, r gocoding.Renderer, v reflect.Value) + func DecodeBinary(bytes *string) ([]byte, error) + func DecodeStringToChainName(pathstr string) (name [][]byte) + func EncodeBinary(bytes *[]byte) string + func EncodeChainNameToString(name [][]byte) (pathstr string) + func NewDecoding(decoding gocoding.Decoding) gocoding.Decoding + func NewJSONUnmarshaller() gocoding.Unmarshaller + func NewUnmarshaller(decoding gocoding.Decoding) gocoding.Unmarshaller + func StartDynamic(path string, readEH func(err error)) error + func StartStatic(path string) (err error) + func UnmarshalJSON(reader gocoding.SliceableRuneReader, obj interface{}) error + func Verify(publicKey *[ed25519.PublicKeySize]byte, message []byte, ...) bool + func VerifySlice(p []byte, message []byte, s []byte) bool + type BinaryMarshallable interface + MarshalledSize func() uint64 + type BuyCBEntry struct + FactomTxHash *Hash + func NewBuyCBEntry(pubKey *Hash, factoidTxHash *Hash, credits int32) *BuyCBEntry + func (e *BuyCBEntry) Credits() int32 + func (e *BuyCBEntry) MarshalBinary() (data []byte, err error) + func (e *BuyCBEntry) MarshalledSize() uint64 + func (e *BuyCBEntry) PublicKey() *Hash + func (e *BuyCBEntry) Type() byte + func (e *BuyCBEntry) UnmarshalBinary(data []byte) (err error) + type ByteArray []byte + func NewByteArray(newHash []byte) (*ByteArray, error) + func (ba ByteArray) Bytes() []byte + func (ba ByteArray) MarshalBinary() ([]byte, error) + func (ba ByteArray) MarshalledSize() uint64 + func (ba ByteArray) SetBytes(newArray []byte) error + func (ba ByteArray) UnmarshalBinary(data []byte) (error, []byte) + type CBEntry interface + Credits func() int32 + MarshalBinary func() ([]byte, error) + MarshalledSize func() uint64 + PublicKey func() *Hash + Type func() byte + UnmarshalBinary func(data []byte) (err error) + type CBInfo struct + CBHash *Hash + ChainID *Hash + FBBlockNum uint64 + FBHash *Hash + func (b *CBInfo) MarshalBinary() (data []byte, err error) + func (b *CBInfo) MarshalledSize() uint64 + func (b *CBInfo) UnmarshalBinary(data []byte) (err error) + type CBlock struct + CBEntries []CBEntry + CBHash *Hash + Chain *CChain + Header *CBlockHeader + IsSealed bool + Salt *Hash + func CreateCBlock(chain *CChain, prev *CBlock, cap uint) (b *CBlock, err error) + func (b *CBlock) AddCBEntry(e CBEntry) (err error) + func (b *CBlock) MarshalBinary() (data []byte, err error) + func (b *CBlock) MarshalledSize() uint64 + func (b *CBlock) UnmarshalBinary(data []byte) (err error) + type CBlockHeader struct + BlockID uint64 + EntryCount uint32 + PrevBlockHash *Hash + TimeStamp int64 + func NewCBlockHeader(blockId uint64, prevHash *Hash, merkle *Hash) *CBlockHeader + func (b *CBlockHeader) MarshalBinary() (data []byte, err error) + func (b *CBlockHeader) MarshalledSize() uint64 + func (b *CBlockHeader) UnmarshalBinary(data []byte) (err error) + type CChain struct + BlockMutex sync.Mutex + Blocks []*CBlock + ChainID *Hash + CurrentBlock *CBlock + Name [][]byte + NextBlockID uint64 + func (b *CChain) MarshalBinary() (data []byte, err error) + func (b *CChain) MarshalledSize() uint64 + func (b *CChain) UnmarshalBinary(data []byte) (err error) + type DBEntry struct + ChainID *Hash + MerkleRoot *Hash + func NewDBEntry(eb *EBlock) *DBEntry + func NewDBEntryFromCBlock(cb *CBlock) *DBEntry + func (e *DBEntry) EncodableFields() map[string]reflect.Value + func (e *DBEntry) GetBinaryTimeStamp() []byte + func (e *DBEntry) Hash() *Hash + func (e *DBEntry) MarshalBinary() (data []byte, err error) + func (e *DBEntry) MarshalledSize() (size uint64) + func (e *DBEntry) RealTime() time.Time + func (e *DBEntry) SetHash(binaryHash []byte) + func (e *DBEntry) SetTimeStamp(binaryTime []byte) + func (e *DBEntry) ShaHash() *Hash + func (e *DBEntry) StampTime() + func (e *DBEntry) TimeStamp() int64 + func (e *DBEntry) UnmarshalBinary(data []byte) (err error) + type DBInfo struct + BTCBlockHash *Hash + BTCBlockHeight int32 + BTCTxHash *Hash + BTCTxOffset int + DBHash *Hash + DBMerkleRoot *Hash + func NewDBInfoFromDBlock(b *DBlock) *DBInfo + func (b *DBInfo) MarshalBinary() (data []byte, err error) + func (b *DBInfo) MarshalledSize() uint64 + func (b *DBInfo) UnmarshalBinary(data []byte) (err error) + type DBlock struct + Chain *DChain + DBEntries []*DBEntry + DBHash *Hash + Header *DBlockHeader + IsSealed bool + Salt *Hash + func CreateDBlock(chain *DChain, prev *DBlock, cap uint) (b *DBlock, err error) + func (b *DBlock) CalculateMerkleRoot() *Hash + func (b *DBlock) EncodableFields() map[string]reflect.Value + func (b *DBlock) MarshalBinary() (data []byte, err error) + func (b *DBlock) MarshalledSize() uint64 + func (b *DBlock) UnmarshalBinary(data []byte) (err error) + type DBlockHeader struct + BatchFlag byte + BlockID uint64 + EntryCount uint32 + MerkleRoot *Hash + PrevBlockHash *Hash + TimeStamp int64 + Version int32 + func NewDBlockHeader(blockId uint64, prevHash *Hash, version int32, count uint32) *DBlockHeader + func (b *DBlockHeader) MarshalBinary() (data []byte, err error) + func (b *DBlockHeader) MarshalledSize() uint64 + func (b *DBlockHeader) RealTime() time.Time + func (b *DBlockHeader) UnmarshalBinary(data []byte) (err error) + type DChain struct + BlockMutex sync.Mutex + Blocks []*DBlock + ChainID *Hash + CurrentBlock *DBlock + NextBlockID uint64 + func (dchain *DChain) AddCBlockToDBEntry(cb *CBlock) (err error) + func (dchain *DChain) AddDBEntry(eb *EBlock) (err error) + func (dchain *DChain) AddFBlockToDBEntry(dbEntry *DBEntry) (err error) + type DetachedPublicKey [ed25519.PublicKeySize]byte + type DetachedSignature [ed25519.SignatureSize]byte + func (ds *DetachedSignature) String() string + type EBEntry struct + ChainID *[]byte + func NewEBEntry(h *Hash, id *[]byte) *EBEntry + func (e *EBEntry) EncodableFields() map[string]reflect.Value + func (e *EBEntry) GetBinaryTimeStamp() []byte + func (e *EBEntry) Hash() *Hash + func (e *EBEntry) MarshalBinary() ([]byte, error) + func (e *EBEntry) MarshalledSize() uint64 + func (e *EBEntry) RealTime() time.Time + func (e *EBEntry) SetHash(binaryHash []byte) + func (e *EBEntry) SetIntTimeStamp(ts int64) + func (e *EBEntry) SetTimeStamp(binaryTime []byte) + func (e *EBEntry) ShaHash() *Hash + func (e *EBEntry) StampTime() + func (e *EBEntry) TimeStamp() int64 + func (e *EBEntry) UnmarshalBinary(data []byte) (err error) + type EBInfo struct + ChainID *Hash + DBBlockNum uint64 + DBHash *Hash + EBHash *Hash + MerkleRoot *Hash + func (b *EBInfo) MarshalBinary() (data []byte, err error) + func (b *EBInfo) MarshalledSize() (size uint64) + func (b *EBInfo) UnmarshalBinary(data []byte) (err error) + type EBlock struct + Chain *EChain + EBEntries []*EBEntry + EBHash *Hash + Header *EBlockHeader + IsSealed bool + MerkleRoot *Hash + Salt *Hash + func CreateBlock(chain *EChain, prev *EBlock, capacity uint) (b *EBlock, err error) + func (b *EBlock) AddEBEntry(e *Entry) (err error) + func (b *EBlock) MarshalBinary() (data []byte, err error) + func (b *EBlock) MarshalledSize() (size uint64) + func (b *EBlock) UnmarshalBinary(data []byte) (err error) + type EBlockHeader struct + BlockID uint64 + PrevBlockHash *Hash + TimeStamp int64 + func NewEBlockHeader(blockId uint64, prevHash *Hash, merkle *Hash) *EBlockHeader + func (b *EBlockHeader) MarshalBinary() (data []byte, err error) + func (b *EBlockHeader) MarshalledSize() uint64 + func (b *EBlockHeader) UnmarshalBinary(data []byte) (err error) + func (e *EBlockHeader) RealTime() time.Time + type ECBalance struct + Credits int32 + PublicKey *Hash + type EChain struct + BlockMutex sync.Mutex + Blocks []*EBlock + ChainID *Hash + CurrentBlock *EBlock + FirstEntry *Entry + Name [][]byte + NextBlockID uint64 + func (b *EChain) EncodableFields() map[string]reflect.Value + func (b *EChain) GenerateIDFromName() (chainID *Hash, err error) + func (b *EChain) MarshalBinary() (data []byte, err error) + func (b *EChain) MarshalledSize() uint64 + func (b *EChain) UnmarshalBinary(data []byte) (err error) + type Entry struct + ChainID Hash + Data []byte + ExtIDs [][]byte + func (e *Entry) MarshalBinary() ([]byte, error) + func (e *Entry) MarshalledSize() uint64 + func (e *Entry) UnmarshalBinary(data []byte) (err error) + type EntryInfo struct + EBBlockNum uint64 + EBHash *Hash + EntryHash *Hash + func (e *EntryInfo) MarshalBinary() (data []byte, err error) + func (e *EntryInfo) MarshalledSize() uint64 + func (e *EntryInfo) UnmarshalBinary(data []byte) (err error) + type EntryInfoBranch struct + DBInfo *DBInfo + EBInfo *EBInfo + EntryHash *Hash + EntryInfo *EntryInfo + type Error struct + APICode uint + Description string + HTTPCode int + Message string + Name string + SupportURL string + func CreateError(code uint, message string) *Error + func Marshal(resource interface{}, accept string, writer io.Writer, alt bool) (r *Error) + func (r *Error) Error() string + type Hash struct + Bytes []byte + func BuildMerkleTreeStore(hashes []*Hash) (merkles []*Hash) + func CreateHash(entities ...BinaryMarshallable) (h *Hash, err error) + func HexToHash(hexStr string) (h *Hash, err error) + func NewHash() *Hash + func NewShaHash(newHash []byte) (*Hash, error) + func Sha(p []byte) (h *Hash) + func (a *Hash) IsSameAs(b *Hash) bool + func (h *Hash) BTCString() string + func (h *Hash) ByteString() string + func (h *Hash) Decoding(m gocoding.Unmarshaller, t reflect.Type) gocoding.Decoder + func (h *Hash) Encoding(m gocoding.Marshaller, t reflect.Type) gocoding.Encoder + func (h *Hash) GetBytes() []byte + func (h *Hash) MarshalBinary() ([]byte, error) + func (h *Hash) MarshalledSize() uint64 + func (h *Hash) String() string + func (h *Hash) UnmarshalBinary(p []byte) error + func (hash *Hash) SetBytes(newHash []byte) error + type HashF [HashSize]byte + func (h *HashF) From(hash *Hash) + func (h HashF) Hash() Hash + type PayChainCBEntry struct + ChainIDHash *Hash + EntryChainIDHash *Hash + EntryHash *Hash + func NewPayChainCBEntry(pubKey *Hash, entryHash *Hash, credits int32, chainIDHash *Hash, ...) *PayChainCBEntry + func (e *PayChainCBEntry) Credits() int32 + func (e *PayChainCBEntry) MarshalBinary() (data []byte, err error) + func (e *PayChainCBEntry) MarshalledSize() uint64 + func (e *PayChainCBEntry) PublicKey() *Hash + func (e *PayChainCBEntry) Type() byte + func (e *PayChainCBEntry) UnmarshalBinary(data []byte) (err error) + type PayEntryCBEntry struct + EntryHash *Hash + TimeStamp int64 + func NewPayEntryCBEntry(pubKey *Hash, entryHash *Hash, credits int32, timeStamp int64) *PayEntryCBEntry + func (e *PayEntryCBEntry) Credits() int32 + func (e *PayEntryCBEntry) MarshalBinary() (data []byte, err error) + func (e *PayEntryCBEntry) MarshalledSize() uint64 + func (e *PayEntryCBEntry) PublicKey() *Hash + func (e *PayEntryCBEntry) Type() byte + func (e *PayEntryCBEntry) UnmarshalBinary(data []byte) (err error) + type PrivateKey struct + Key *[ed25519.PrivateKeySize]byte + Pub PublicKey + func (pk *PrivateKey) AllocateNew() + func (pk *PrivateKey) GenerateKey() (err error) + func (pk PrivateKey) MarshalSign(msg BinaryMarshallable) (sig Signature) + func (pk PrivateKey) Public() []byte + func (pk PrivateKey) Sign(msg []byte) (sig Signature) + type PublicKey struct + Key *[ed25519.PublicKeySize]byte + func PubKeyFromString(instr string) (pk PublicKey) + func (k PublicKey) Verify(msg []byte, sig *[ed25519.SignatureSize]byte) bool + func (pk PublicKey) String() string + type Signature struct + Pub PublicKey + Sig *[ed25519.SignatureSize]byte + func UnmarshalBinarySignature(data []byte) (sig Signature) + func (sig *Signature) DetachSig() *DetachedSignature + func (sig Signature) Key() []byte + func (sig Signature) Verify(msg []byte) bool + type Signer interface + Sign func(msg []byte) Signature + type SimpleData struct + Data []byte + func (d *SimpleData) MarshalBinary() ([]byte, error) + func (d *SimpleData) MarshalledSize() uint64 + func (d *SimpleData) UnmarshalBinary([]byte) error + type Verifyer interface + Verify func(msg []byte) bool