Documentation ¶
Index ¶
- Constants
- func BytesToHex(b []byte) string
- func DecodeHexBytes(b []byte) ([]byte, error)
- func DecodeHexStr(str string) ([]byte, error)
- func HexDigest(str string, startPos, endPos int64) string
- func NewTransactionProcessor(validator string, handler processor.TransactionHandler) *processor.TransactionProcessor
- func ProofOfIntegrityHash(data []byte) string
- func StrToHex(str string) string
- func VerifyPOIHash(b []byte, check string) (string, bool)
- func VerifySig(signature string, publicKey, message []byte, hexEnc bool) bool
- type AddressBuilder
- type AddressPart
- type File
- type IPFSClient
- type MethodDelegate
- type MethodHandler
- type NamespaceMngr
- type RPCClient
- type RPCDelegateCB
- type Response
- type State
- type TransactionHandler
Constants ¶
View Source
const MaxLength = 70
View Source
const (
PrefixEndPos = 6
)
Variables ¶
This section is empty.
Functions ¶
func DecodeHexBytes ¶
DecodeHexBytes return hex decoded bytes
func DecodeHexStr ¶
DecodeHexStr return hex decoded bytes
func NewTransactionProcessor ¶
func NewTransactionProcessor(validator string, handler processor.TransactionHandler) *processor.TransactionProcessor
func ProofOfIntegrityHash ¶
ProofOfIntegrityHash create a proof of intergrity hash
func VerifyPOIHash ¶
VerifyPOIHash verify proof of integrity hash provided for some data is valid
Types ¶
type AddressBuilder ¶
type AddressBuilder struct { Prefix string Parts []*AddressPart }
func NewAddress ¶
func NewAddress(prefix string) *AddressBuilder
func (*AddressBuilder) AddParts ¶
func (a *AddressBuilder) AddParts(part ...*AddressPart) *AddressBuilder
func (*AddressBuilder) Build ¶
func (a *AddressBuilder) Build() (string, bool)
func (*AddressBuilder) IsValidSize ¶
func (a *AddressBuilder) IsValidSize() bool
type AddressPart ¶
func NewPart ¶
func NewPart(data string, startPos, endPos int64) *AddressPart
type File ¶
type File struct { Data string `json:"data"` LastModified int64 `json:"last_modified"` Name string `json:"name"` FileType string `json:"file_type"` }
File ...
type IPFSClient ¶
IPFSClient ...
func (*IPFSClient) GetFileName ¶
func (ipfs *IPFSClient) GetFileName(name, filetype string) string
GetFileName ...
type MethodDelegate ¶
type MethodDelegate interface {
DelegateMethod(*processor_pb2.TpProcessRequest, *processor.Context) error
}
type MethodHandler ¶
type MethodHandler interface { Handle(*processor_pb2.TpProcessRequest, *processor.Context, interface{}) error Method() string }
type NamespaceMngr ¶
type NamespaceMngr struct {
NameSpaces []string
}
NamespaceMngr
func NewNamespaceMngr ¶
func NewNamespaceMngr() *NamespaceMngr
func (*NamespaceMngr) ComputeDefaultPrefix ¶
func (s *NamespaceMngr) ComputeDefaultPrefix(prefix string) string
ComputeDefaultPrefix returns namespace prefix of 6 bytes for our default prefixes that will be used to generate various state address's
func (*NamespaceMngr) RegisterNamespaces ¶
func (s *NamespaceMngr) RegisterNamespaces(prefixes ...string) *NamespaceMngr
RegisterNamespaces register a namespace with our state address manager
type RPCClient ¶
type RPCClient struct { MethodHandlers map[string]MethodHandler // contains filtered or unexported fields }
func NewRPCClient ¶
func NewRPCClient(methodHandlers []MethodHandler, delegateDB RPCDelegateCB) *RPCClient
func (*RPCClient) DelegateMethod ¶
func (r *RPCClient) DelegateMethod(request *processor_pb2.TpProcessRequest, context *processor.Context) error
type RPCDelegateCB ¶
type RPCDelegateCB func(request *processor_pb2.TpProcessRequest) (string, interface{}, error)
type Response ¶
type Response struct { Name string `json:"Name"` Hash string `json:"Hash"` Bytes int64 `json:"Bytes"` Size string `json:"Size"` }
Response ...
type TransactionHandler ¶
type TransactionHandler struct { FName string `json:"familyName"` FVersions []string `json:"familyVersions"` MethodDelegate MethodDelegate NamespaceMngr *NamespaceMngr }
TransactionHandler ...
func NewTransactionHandler ¶
func NewTransactionHandler(methodDelegate MethodDelegate, fname string, fversions, namespaces []string) *TransactionHandler
NewTransactionHandler returns a new transaction handler
func (*TransactionHandler) Apply ¶
func (t *TransactionHandler) Apply(request *processor_pb2.TpProcessRequest, context *processor.Context) error
Apply ...
func (*TransactionHandler) FamilyName ¶
func (t *TransactionHandler) FamilyName() string
FamilyName ...
func (*TransactionHandler) FamilyVersions ¶
func (t *TransactionHandler) FamilyVersions() []string
FamilyVersions ...
func (*TransactionHandler) Namespaces ¶
func (t *TransactionHandler) Namespaces() []string
Namespaces ...
Source Files ¶
Click to show internal directories.
Click to hide internal directories.