Documentation ¶
Index ¶
- Constants
- Variables
- func InitExecutor(cfg *types.TuringchainConfig)
- func InitFork(cfg *types.TuringchainConfig)
- func RegisterStorageServer(s *grpc.Server, srv StorageServer)
- type BatchQueryStorage
- func (*BatchQueryStorage) Descriptor() ([]byte, []int)
- func (m *BatchQueryStorage) GetTxHashs() []string
- func (*BatchQueryStorage) ProtoMessage()
- func (m *BatchQueryStorage) Reset()
- func (m *BatchQueryStorage) String() string
- func (m *BatchQueryStorage) XXX_DiscardUnknown()
- func (m *BatchQueryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BatchQueryStorage) XXX_Merge(src proto.Message)
- func (m *BatchQueryStorage) XXX_Size() int
- func (m *BatchQueryStorage) XXX_Unmarshal(b []byte) error
- type BatchReplyStorage
- func (*BatchReplyStorage) Descriptor() ([]byte, []int)
- func (m *BatchReplyStorage) GetStorages() []*Storage
- func (*BatchReplyStorage) ProtoMessage()
- func (m *BatchReplyStorage) Reset()
- func (m *BatchReplyStorage) String() string
- func (m *BatchReplyStorage) XXX_DiscardUnknown()
- func (m *BatchReplyStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BatchReplyStorage) XXX_Merge(src proto.Message)
- func (m *BatchReplyStorage) XXX_Size() int
- func (m *BatchReplyStorage) XXX_Unmarshal(b []byte) error
- type ContentOnlyNotaryStorage
- func (*ContentOnlyNotaryStorage) Descriptor() ([]byte, []int)
- func (m *ContentOnlyNotaryStorage) GetContent() []byte
- func (m *ContentOnlyNotaryStorage) GetKey() string
- func (m *ContentOnlyNotaryStorage) GetOp() int32
- func (m *ContentOnlyNotaryStorage) GetValue() string
- func (*ContentOnlyNotaryStorage) ProtoMessage()
- func (m *ContentOnlyNotaryStorage) Reset()
- func (m *ContentOnlyNotaryStorage) String() string
- func (m *ContentOnlyNotaryStorage) XXX_DiscardUnknown()
- func (m *ContentOnlyNotaryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ContentOnlyNotaryStorage) XXX_Merge(src proto.Message)
- func (m *ContentOnlyNotaryStorage) XXX_Size() int
- func (m *ContentOnlyNotaryStorage) XXX_Unmarshal(b []byte) error
- type EncryptNotaryAdd
- func (*EncryptNotaryAdd) Descriptor() ([]byte, []int)
- func (m *EncryptNotaryAdd) GetEncryptAdd() []byte
- func (m *EncryptNotaryAdd) GetKey() string
- func (*EncryptNotaryAdd) ProtoMessage()
- func (m *EncryptNotaryAdd) Reset()
- func (m *EncryptNotaryAdd) String() string
- func (m *EncryptNotaryAdd) XXX_DiscardUnknown()
- func (m *EncryptNotaryAdd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EncryptNotaryAdd) XXX_Merge(src proto.Message)
- func (m *EncryptNotaryAdd) XXX_Size() int
- func (m *EncryptNotaryAdd) XXX_Unmarshal(b []byte) error
- type EncryptNotaryStorage
- func (*EncryptNotaryStorage) Descriptor() ([]byte, []int)
- func (m *EncryptNotaryStorage) GetContentHash() []byte
- func (m *EncryptNotaryStorage) GetEncryptContent() []byte
- func (m *EncryptNotaryStorage) GetKey() string
- func (m *EncryptNotaryStorage) GetNonce() []byte
- func (m *EncryptNotaryStorage) GetValue() string
- func (*EncryptNotaryStorage) ProtoMessage()
- func (m *EncryptNotaryStorage) Reset()
- func (m *EncryptNotaryStorage) String() string
- func (m *EncryptNotaryStorage) XXX_DiscardUnknown()
- func (m *EncryptNotaryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EncryptNotaryStorage) XXX_Merge(src proto.Message)
- func (m *EncryptNotaryStorage) XXX_Size() int
- func (m *EncryptNotaryStorage) XXX_Unmarshal(b []byte) error
- type EncryptShareNotaryStorage
- func (*EncryptShareNotaryStorage) Descriptor() ([]byte, []int)
- func (m *EncryptShareNotaryStorage) GetContentHash() []byte
- func (m *EncryptShareNotaryStorage) GetEncryptContent() []byte
- func (m *EncryptShareNotaryStorage) GetKey() string
- func (m *EncryptShareNotaryStorage) GetPubKey() []byte
- func (m *EncryptShareNotaryStorage) GetValue() string
- func (*EncryptShareNotaryStorage) ProtoMessage()
- func (m *EncryptShareNotaryStorage) Reset()
- func (m *EncryptShareNotaryStorage) String() string
- func (m *EncryptShareNotaryStorage) XXX_DiscardUnknown()
- func (m *EncryptShareNotaryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EncryptShareNotaryStorage) XXX_Merge(src proto.Message)
- func (m *EncryptShareNotaryStorage) XXX_Size() int
- func (m *EncryptShareNotaryStorage) XXX_Unmarshal(b []byte) error
- type HashOnlyNotaryStorage
- func (*HashOnlyNotaryStorage) Descriptor() ([]byte, []int)
- func (m *HashOnlyNotaryStorage) GetHash() []byte
- func (m *HashOnlyNotaryStorage) GetKey() string
- func (m *HashOnlyNotaryStorage) GetValue() string
- func (*HashOnlyNotaryStorage) ProtoMessage()
- func (m *HashOnlyNotaryStorage) Reset()
- func (m *HashOnlyNotaryStorage) String() string
- func (m *HashOnlyNotaryStorage) XXX_DiscardUnknown()
- func (m *HashOnlyNotaryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HashOnlyNotaryStorage) XXX_Merge(src proto.Message)
- func (m *HashOnlyNotaryStorage) XXX_Size() int
- func (m *HashOnlyNotaryStorage) XXX_Unmarshal(b []byte) error
- type LinkNotaryStorage
- func (*LinkNotaryStorage) Descriptor() ([]byte, []int)
- func (m *LinkNotaryStorage) GetHash() []byte
- func (m *LinkNotaryStorage) GetKey() string
- func (m *LinkNotaryStorage) GetLink() []byte
- func (m *LinkNotaryStorage) GetValue() string
- func (*LinkNotaryStorage) ProtoMessage()
- func (m *LinkNotaryStorage) Reset()
- func (m *LinkNotaryStorage) String() string
- func (m *LinkNotaryStorage) XXX_DiscardUnknown()
- func (m *LinkNotaryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LinkNotaryStorage) XXX_Merge(src proto.Message)
- func (m *LinkNotaryStorage) XXX_Size() int
- func (m *LinkNotaryStorage) XXX_Unmarshal(b []byte) error
- type QueryStorage
- func (*QueryStorage) Descriptor() ([]byte, []int)
- func (m *QueryStorage) GetTxHash() string
- func (*QueryStorage) ProtoMessage()
- func (m *QueryStorage) Reset()
- func (m *QueryStorage) String() string
- func (m *QueryStorage) XXX_DiscardUnknown()
- func (m *QueryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryStorage) XXX_Merge(src proto.Message)
- func (m *QueryStorage) XXX_Size() int
- func (m *QueryStorage) XXX_Unmarshal(b []byte) error
- type ReceiptStorage
- func (*ReceiptStorage) Descriptor() ([]byte, []int)
- func (*ReceiptStorage) ProtoMessage()
- func (m *ReceiptStorage) Reset()
- func (m *ReceiptStorage) String() string
- func (m *ReceiptStorage) XXX_DiscardUnknown()
- func (m *ReceiptStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ReceiptStorage) XXX_Merge(src proto.Message)
- func (m *ReceiptStorage) XXX_Size() int
- func (m *ReceiptStorage) XXX_Unmarshal(b []byte) error
- type Storage
- func (*Storage) Descriptor() ([]byte, []int)
- func (m *Storage) GetContentStorage() *ContentOnlyNotaryStorage
- func (m *Storage) GetEncryptAdd() *EncryptNotaryAdd
- func (m *Storage) GetEncryptShareStorage() *EncryptShareNotaryStorage
- func (m *Storage) GetEncryptStorage() *EncryptNotaryStorage
- func (m *Storage) GetHashStorage() *HashOnlyNotaryStorage
- func (m *Storage) GetLinkStorage() *LinkNotaryStorage
- func (m *Storage) GetTy() int32
- func (m *Storage) GetValue() isStorage_Value
- func (*Storage) ProtoMessage()
- func (m *Storage) Reset()
- func (m *Storage) String() string
- func (m *Storage) XXX_DiscardUnknown()
- func (m *Storage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Storage) XXX_Merge(src proto.Message)
- func (*Storage) XXX_OneofWrappers() []interface{}
- func (m *Storage) XXX_Size() int
- func (m *Storage) XXX_Unmarshal(b []byte) error
- type StorageAction
- func (*StorageAction) Descriptor() ([]byte, []int)
- func (m *StorageAction) GetContentStorage() *ContentOnlyNotaryStorage
- func (m *StorageAction) GetEncryptAdd() *EncryptNotaryAdd
- func (m *StorageAction) GetEncryptShareStorage() *EncryptShareNotaryStorage
- func (m *StorageAction) GetEncryptStorage() *EncryptNotaryStorage
- func (m *StorageAction) GetHashStorage() *HashOnlyNotaryStorage
- func (m *StorageAction) GetLinkStorage() *LinkNotaryStorage
- func (m *StorageAction) GetTy() int32
- func (m *StorageAction) GetValue() isStorageAction_Value
- func (*StorageAction) ProtoMessage()
- func (m *StorageAction) Reset()
- func (m *StorageAction) String() string
- func (m *StorageAction) XXX_DiscardUnknown()
- func (m *StorageAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *StorageAction) XXX_Merge(src proto.Message)
- func (*StorageAction) XXX_OneofWrappers() []interface{}
- func (m *StorageAction) XXX_Size() int
- func (m *StorageAction) XXX_Unmarshal(b []byte) error
- type StorageAction_ContentStorage
- type StorageAction_EncryptAdd
- type StorageAction_EncryptShareStorage
- type StorageAction_EncryptStorage
- type StorageAction_HashStorage
- type StorageAction_LinkStorage
- type StorageClient
- type StorageServer
- type StorageType
- type Storage_ContentStorage
- type Storage_EncryptAdd
- type Storage_EncryptShareStorage
- type Storage_EncryptStorage
- type Storage_HashStorage
- type Storage_LinkStorage
- type UnimplementedStorageServer
Constants ¶
const ( TyUnknowAction = iota TyContentStorageAction TyHashStorageAction TyLinkStorageAction TyEncryptStorageAction TyEncryptAddAction NameContentStorageAction = "ContentStorage" NameHashStorageAction = "HashStorage" NameLinkStorageAction = "LinkStorage" NameEncryptStorageAction = "EncryptStorage" NameEncryptAddAction = "EncryptAdd" FuncNameQueryStorage = "QueryStorage" FuncNameBatchQueryStorage = "BatchQueryStorage" )
action类型id和name,这些常量可以自定义修改
const ( TyUnknownLog = iota TyContentStorageLog TyHashStorageLog TyLinkStorageLog TyEncryptStorageLog TyEncryptAddLog )
log类型id值
const ( OpCreate = int32(iota) OpAdd )
storage op
Variables ¶
var ( ErrKeyExisted = fmt.Errorf("%s", "The key has already existed!") ErrStorageType = fmt.Errorf("%s", "The key has used storage another type!") )
some errors definition
var (
ForkStorageLocalDB = "ForkStorageLocalDB"
)
fork
var (
//StorageX 执行器名称定义
StorageX = "storage"
)
Functions ¶
func InitExecutor ¶
func InitExecutor(cfg *types.TuringchainConfig)
InitExecutor defines register executor
func RegisterStorageServer ¶
func RegisterStorageServer(s *grpc.Server, srv StorageServer)
Types ¶
type BatchQueryStorage ¶
type BatchQueryStorage struct { TxHashs []string `protobuf:"bytes,1,rep,name=txHashs,proto3" json:"txHashs,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
批量查询有可能导致数据库崩溃
func (*BatchQueryStorage) Descriptor ¶
func (*BatchQueryStorage) Descriptor() ([]byte, []int)
func (*BatchQueryStorage) GetTxHashs ¶
func (m *BatchQueryStorage) GetTxHashs() []string
func (*BatchQueryStorage) ProtoMessage ¶
func (*BatchQueryStorage) ProtoMessage()
func (*BatchQueryStorage) Reset ¶
func (m *BatchQueryStorage) Reset()
func (*BatchQueryStorage) String ¶
func (m *BatchQueryStorage) String() string
func (*BatchQueryStorage) XXX_DiscardUnknown ¶
func (m *BatchQueryStorage) XXX_DiscardUnknown()
func (*BatchQueryStorage) XXX_Marshal ¶
func (m *BatchQueryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*BatchQueryStorage) XXX_Merge ¶
func (m *BatchQueryStorage) XXX_Merge(src proto.Message)
func (*BatchQueryStorage) XXX_Size ¶
func (m *BatchQueryStorage) XXX_Size() int
func (*BatchQueryStorage) XXX_Unmarshal ¶
func (m *BatchQueryStorage) XXX_Unmarshal(b []byte) error
type BatchReplyStorage ¶
type BatchReplyStorage struct { Storages []*Storage `protobuf:"bytes,1,rep,name=storages,proto3" json:"storages,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*BatchReplyStorage) Descriptor ¶
func (*BatchReplyStorage) Descriptor() ([]byte, []int)
func (*BatchReplyStorage) GetStorages ¶
func (m *BatchReplyStorage) GetStorages() []*Storage
func (*BatchReplyStorage) ProtoMessage ¶
func (*BatchReplyStorage) ProtoMessage()
func (*BatchReplyStorage) Reset ¶
func (m *BatchReplyStorage) Reset()
func (*BatchReplyStorage) String ¶
func (m *BatchReplyStorage) String() string
func (*BatchReplyStorage) XXX_DiscardUnknown ¶
func (m *BatchReplyStorage) XXX_DiscardUnknown()
func (*BatchReplyStorage) XXX_Marshal ¶
func (m *BatchReplyStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*BatchReplyStorage) XXX_Merge ¶
func (m *BatchReplyStorage) XXX_Merge(src proto.Message)
func (*BatchReplyStorage) XXX_Size ¶
func (m *BatchReplyStorage) XXX_Size() int
func (*BatchReplyStorage) XXX_Unmarshal ¶
func (m *BatchReplyStorage) XXX_Unmarshal(b []byte) error
type ContentOnlyNotaryStorage ¶
type ContentOnlyNotaryStorage struct { //长度需要小于512k Content []byte `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` //自定义的主键,可以为空,如果没传,则用txhash为key Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // Op 0表示创建 1表示追加add Op int32 `protobuf:"varint,3,opt,name=op,proto3" json:"op,omitempty"` //字符串值 Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
内容存证模型
func (*ContentOnlyNotaryStorage) Descriptor ¶
func (*ContentOnlyNotaryStorage) Descriptor() ([]byte, []int)
func (*ContentOnlyNotaryStorage) GetContent ¶
func (m *ContentOnlyNotaryStorage) GetContent() []byte
func (*ContentOnlyNotaryStorage) GetKey ¶
func (m *ContentOnlyNotaryStorage) GetKey() string
func (*ContentOnlyNotaryStorage) GetOp ¶
func (m *ContentOnlyNotaryStorage) GetOp() int32
func (*ContentOnlyNotaryStorage) GetValue ¶
func (m *ContentOnlyNotaryStorage) GetValue() string
func (*ContentOnlyNotaryStorage) ProtoMessage ¶
func (*ContentOnlyNotaryStorage) ProtoMessage()
func (*ContentOnlyNotaryStorage) Reset ¶
func (m *ContentOnlyNotaryStorage) Reset()
func (*ContentOnlyNotaryStorage) String ¶
func (m *ContentOnlyNotaryStorage) String() string
func (*ContentOnlyNotaryStorage) XXX_DiscardUnknown ¶
func (m *ContentOnlyNotaryStorage) XXX_DiscardUnknown()
func (*ContentOnlyNotaryStorage) XXX_Marshal ¶
func (m *ContentOnlyNotaryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ContentOnlyNotaryStorage) XXX_Merge ¶
func (m *ContentOnlyNotaryStorage) XXX_Merge(src proto.Message)
func (*ContentOnlyNotaryStorage) XXX_Size ¶
func (m *ContentOnlyNotaryStorage) XXX_Size() int
func (*ContentOnlyNotaryStorage) XXX_Unmarshal ¶
func (m *ContentOnlyNotaryStorage) XXX_Unmarshal(b []byte) error
type EncryptNotaryAdd ¶
type EncryptNotaryAdd struct { //源操作数存证索引 Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //待操作数据 EncryptAdd []byte `protobuf:"bytes,2,opt,name=encryptAdd,proto3" json:"encryptAdd,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
加密存证数据运算
func (*EncryptNotaryAdd) Descriptor ¶
func (*EncryptNotaryAdd) Descriptor() ([]byte, []int)
func (*EncryptNotaryAdd) GetEncryptAdd ¶
func (m *EncryptNotaryAdd) GetEncryptAdd() []byte
func (*EncryptNotaryAdd) GetKey ¶
func (m *EncryptNotaryAdd) GetKey() string
func (*EncryptNotaryAdd) ProtoMessage ¶
func (*EncryptNotaryAdd) ProtoMessage()
func (*EncryptNotaryAdd) Reset ¶
func (m *EncryptNotaryAdd) Reset()
func (*EncryptNotaryAdd) String ¶
func (m *EncryptNotaryAdd) String() string
func (*EncryptNotaryAdd) XXX_DiscardUnknown ¶
func (m *EncryptNotaryAdd) XXX_DiscardUnknown()
func (*EncryptNotaryAdd) XXX_Marshal ¶
func (m *EncryptNotaryAdd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EncryptNotaryAdd) XXX_Merge ¶
func (m *EncryptNotaryAdd) XXX_Merge(src proto.Message)
func (*EncryptNotaryAdd) XXX_Size ¶
func (m *EncryptNotaryAdd) XXX_Size() int
func (*EncryptNotaryAdd) XXX_Unmarshal ¶
func (m *EncryptNotaryAdd) XXX_Unmarshal(b []byte) error
type EncryptNotaryStorage ¶
type EncryptNotaryStorage struct { //存证明文内容的hash值,推荐使用sha256哈希,限制256位得摘要值 ContentHash []byte `protobuf:"bytes,1,opt,name=contentHash,proto3" json:"contentHash,omitempty"` //源文件得密文,由加密key及nonce对明文加密得到该值。 EncryptContent []byte `protobuf:"bytes,2,opt,name=encryptContent,proto3" json:"encryptContent,omitempty"` //加密iv,通过AES进行加密时制定随机生成的iv,解密时需要使用该值 Nonce []byte `protobuf:"bytes,3,opt,name=nonce,proto3" json:"nonce,omitempty"` //自定义的主键,可以为空,如果没传,则用txhash为key Key string `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"` //字符串值 Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
隐私存证模型,如果一个文件需要存证,且不公开内容,可以选择将源文件通过对称加密算法加密后上链
func (*EncryptNotaryStorage) Descriptor ¶
func (*EncryptNotaryStorage) Descriptor() ([]byte, []int)
func (*EncryptNotaryStorage) GetContentHash ¶
func (m *EncryptNotaryStorage) GetContentHash() []byte
func (*EncryptNotaryStorage) GetEncryptContent ¶
func (m *EncryptNotaryStorage) GetEncryptContent() []byte
func (*EncryptNotaryStorage) GetKey ¶
func (m *EncryptNotaryStorage) GetKey() string
func (*EncryptNotaryStorage) GetNonce ¶
func (m *EncryptNotaryStorage) GetNonce() []byte
func (*EncryptNotaryStorage) GetValue ¶
func (m *EncryptNotaryStorage) GetValue() string
func (*EncryptNotaryStorage) ProtoMessage ¶
func (*EncryptNotaryStorage) ProtoMessage()
func (*EncryptNotaryStorage) Reset ¶
func (m *EncryptNotaryStorage) Reset()
func (*EncryptNotaryStorage) String ¶
func (m *EncryptNotaryStorage) String() string
func (*EncryptNotaryStorage) XXX_DiscardUnknown ¶
func (m *EncryptNotaryStorage) XXX_DiscardUnknown()
func (*EncryptNotaryStorage) XXX_Marshal ¶
func (m *EncryptNotaryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EncryptNotaryStorage) XXX_Merge ¶
func (m *EncryptNotaryStorage) XXX_Merge(src proto.Message)
func (*EncryptNotaryStorage) XXX_Size ¶
func (m *EncryptNotaryStorage) XXX_Size() int
func (*EncryptNotaryStorage) XXX_Unmarshal ¶
func (m *EncryptNotaryStorage) XXX_Unmarshal(b []byte) error
type EncryptShareNotaryStorage ¶
type EncryptShareNotaryStorage struct { byte `protobuf:"bytes,1,opt,name=contentHash,proto3" json:"contentHash,omitempty"` EncryptContent []byte `protobuf:"bytes,2,opt,name=encryptContent,proto3" json:"encryptContent,omitempty"` PubKey []byte `protobuf:"bytes,3,opt,name=pubKey,proto3" json:"pubKey,omitempty"` Key string `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"` //字符串值 }ContentHash []
分享隐私存证模型,需要完备的sdk或者相应的密钥库支持
func (*EncryptShareNotaryStorage) Descriptor ¶
func (*EncryptShareNotaryStorage) Descriptor() ([]byte, []int)
func (*EncryptShareNotaryStorage) GetContentHash ¶
func (m *EncryptShareNotaryStorage) GetContentHash() []byte
func (*EncryptShareNotaryStorage) GetEncryptContent ¶
func (m *EncryptShareNotaryStorage) GetEncryptContent() []byte
func (*EncryptShareNotaryStorage) GetKey ¶
func (m *EncryptShareNotaryStorage) GetKey() string
func (*EncryptShareNotaryStorage) GetPubKey ¶
func (m *EncryptShareNotaryStorage) GetPubKey() []byte
func (*EncryptShareNotaryStorage) GetValue ¶
func (m *EncryptShareNotaryStorage) GetValue() string
func (*EncryptShareNotaryStorage) ProtoMessage ¶
func (*EncryptShareNotaryStorage) ProtoMessage()
func (*EncryptShareNotaryStorage) Reset ¶
func (m *EncryptShareNotaryStorage) Reset()
func (*EncryptShareNotaryStorage) String ¶
func (m *EncryptShareNotaryStorage) String() string
func (*EncryptShareNotaryStorage) XXX_DiscardUnknown ¶
func (m *EncryptShareNotaryStorage) XXX_DiscardUnknown()
func (*EncryptShareNotaryStorage) XXX_Marshal ¶
func (m *EncryptShareNotaryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EncryptShareNotaryStorage) XXX_Merge ¶
func (m *EncryptShareNotaryStorage) XXX_Merge(src proto.Message)
func (*EncryptShareNotaryStorage) XXX_Size ¶
func (m *EncryptShareNotaryStorage) XXX_Size() int
func (*EncryptShareNotaryStorage) XXX_Unmarshal ¶
func (m *EncryptShareNotaryStorage) XXX_Unmarshal(b []byte) error
type HashOnlyNotaryStorage ¶
type HashOnlyNotaryStorage struct { //长度固定为32字节 Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` //自定义的主键,可以为空,如果没传,则用txhash为key Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` //字符串值 Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
哈希存证模型,推荐使用sha256哈希,限制256位得摘要值
func (*HashOnlyNotaryStorage) Descriptor ¶
func (*HashOnlyNotaryStorage) Descriptor() ([]byte, []int)
func (*HashOnlyNotaryStorage) GetHash ¶
func (m *HashOnlyNotaryStorage) GetHash() []byte
func (*HashOnlyNotaryStorage) GetKey ¶
func (m *HashOnlyNotaryStorage) GetKey() string
func (*HashOnlyNotaryStorage) GetValue ¶
func (m *HashOnlyNotaryStorage) GetValue() string
func (*HashOnlyNotaryStorage) ProtoMessage ¶
func (*HashOnlyNotaryStorage) ProtoMessage()
func (*HashOnlyNotaryStorage) Reset ¶
func (m *HashOnlyNotaryStorage) Reset()
func (*HashOnlyNotaryStorage) String ¶
func (m *HashOnlyNotaryStorage) String() string
func (*HashOnlyNotaryStorage) XXX_DiscardUnknown ¶
func (m *HashOnlyNotaryStorage) XXX_DiscardUnknown()
func (*HashOnlyNotaryStorage) XXX_Marshal ¶
func (m *HashOnlyNotaryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HashOnlyNotaryStorage) XXX_Merge ¶
func (m *HashOnlyNotaryStorage) XXX_Merge(src proto.Message)
func (*HashOnlyNotaryStorage) XXX_Size ¶
func (m *HashOnlyNotaryStorage) XXX_Size() int
func (*HashOnlyNotaryStorage) XXX_Unmarshal ¶
func (m *HashOnlyNotaryStorage) XXX_Unmarshal(b []byte) error
type LinkNotaryStorage ¶
type LinkNotaryStorage struct { //存证内容的链接,可以写入URL,或者其他可用于定位源文件得线索. Link []byte `protobuf:"bytes,1,opt,name=link,proto3" json:"link,omitempty"` //源文件得hash值,推荐使用sha256哈希,限制256位得摘要值 Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` //自定义的主键,可以为空,如果没传,则用txhash为key Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` //字符串值 Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
链接存证模型
func (*LinkNotaryStorage) Descriptor ¶
func (*LinkNotaryStorage) Descriptor() ([]byte, []int)
func (*LinkNotaryStorage) GetHash ¶
func (m *LinkNotaryStorage) GetHash() []byte
func (*LinkNotaryStorage) GetKey ¶
func (m *LinkNotaryStorage) GetKey() string
func (*LinkNotaryStorage) GetLink ¶
func (m *LinkNotaryStorage) GetLink() []byte
func (*LinkNotaryStorage) GetValue ¶
func (m *LinkNotaryStorage) GetValue() string
func (*LinkNotaryStorage) ProtoMessage ¶
func (*LinkNotaryStorage) ProtoMessage()
func (*LinkNotaryStorage) Reset ¶
func (m *LinkNotaryStorage) Reset()
func (*LinkNotaryStorage) String ¶
func (m *LinkNotaryStorage) String() string
func (*LinkNotaryStorage) XXX_DiscardUnknown ¶
func (m *LinkNotaryStorage) XXX_DiscardUnknown()
func (*LinkNotaryStorage) XXX_Marshal ¶
func (m *LinkNotaryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*LinkNotaryStorage) XXX_Merge ¶
func (m *LinkNotaryStorage) XXX_Merge(src proto.Message)
func (*LinkNotaryStorage) XXX_Size ¶
func (m *LinkNotaryStorage) XXX_Size() int
func (*LinkNotaryStorage) XXX_Unmarshal ¶
func (m *LinkNotaryStorage) XXX_Unmarshal(b []byte) error
type QueryStorage ¶
type QueryStorage struct { TxHash string `protobuf:"bytes,1,opt,name=txHash,proto3" json:"txHash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
根据txhash去状态数据库中查询存储内容
func (*QueryStorage) Descriptor ¶
func (*QueryStorage) Descriptor() ([]byte, []int)
func (*QueryStorage) GetTxHash ¶
func (m *QueryStorage) GetTxHash() string
func (*QueryStorage) ProtoMessage ¶
func (*QueryStorage) ProtoMessage()
func (*QueryStorage) Reset ¶
func (m *QueryStorage) Reset()
func (*QueryStorage) String ¶
func (m *QueryStorage) String() string
func (*QueryStorage) XXX_DiscardUnknown ¶
func (m *QueryStorage) XXX_DiscardUnknown()
func (*QueryStorage) XXX_Marshal ¶
func (m *QueryStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryStorage) XXX_Merge ¶
func (m *QueryStorage) XXX_Merge(src proto.Message)
func (*QueryStorage) XXX_Size ¶
func (m *QueryStorage) XXX_Size() int
func (*QueryStorage) XXX_Unmarshal ¶
func (m *QueryStorage) XXX_Unmarshal(b []byte) error
type ReceiptStorage ¶
type ReceiptStorage struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ReceiptStorage) Descriptor ¶
func (*ReceiptStorage) Descriptor() ([]byte, []int)
func (*ReceiptStorage) ProtoMessage ¶
func (*ReceiptStorage) ProtoMessage()
func (*ReceiptStorage) Reset ¶
func (m *ReceiptStorage) Reset()
func (*ReceiptStorage) String ¶
func (m *ReceiptStorage) String() string
func (*ReceiptStorage) XXX_DiscardUnknown ¶
func (m *ReceiptStorage) XXX_DiscardUnknown()
func (*ReceiptStorage) XXX_Marshal ¶
func (m *ReceiptStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ReceiptStorage) XXX_Merge ¶
func (m *ReceiptStorage) XXX_Merge(src proto.Message)
func (*ReceiptStorage) XXX_Size ¶
func (m *ReceiptStorage) XXX_Size() int
func (*ReceiptStorage) XXX_Unmarshal ¶
func (m *ReceiptStorage) XXX_Unmarshal(b []byte) error
type Storage ¶
type Storage struct { // Types that are valid to be assigned to Value: // *Storage_ContentStorage // *Storage_HashStorage // *Storage_LinkStorage // *Storage_EncryptStorage // *Storage_EncryptShareStorage // *Storage_EncryptAdd Value isStorage_Value `protobuf_oneof:"value"` Ty int32 `protobuf:"varint,7,opt,name=ty,proto3" json:"ty,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
后面如果有其他数据模型可继续往上面添加
func (*Storage) Descriptor ¶
func (*Storage) GetContentStorage ¶
func (m *Storage) GetContentStorage() *ContentOnlyNotaryStorage
func (*Storage) GetEncryptAdd ¶
func (m *Storage) GetEncryptAdd() *EncryptNotaryAdd
func (*Storage) GetEncryptShareStorage ¶
func (m *Storage) GetEncryptShareStorage() *EncryptShareNotaryStorage
func (*Storage) GetEncryptStorage ¶
func (m *Storage) GetEncryptStorage() *EncryptNotaryStorage
func (*Storage) GetHashStorage ¶
func (m *Storage) GetHashStorage() *HashOnlyNotaryStorage
func (*Storage) GetLinkStorage ¶
func (m *Storage) GetLinkStorage() *LinkNotaryStorage
func (*Storage) ProtoMessage ¶
func (*Storage) ProtoMessage()
func (*Storage) XXX_DiscardUnknown ¶
func (m *Storage) XXX_DiscardUnknown()
func (*Storage) XXX_Marshal ¶
func (*Storage) XXX_OneofWrappers ¶
func (*Storage) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*Storage) XXX_Unmarshal ¶
type StorageAction ¶
type StorageAction struct { // Types that are valid to be assigned to Value: // *StorageAction_ContentStorage // *StorageAction_HashStorage // *StorageAction_LinkStorage // *StorageAction_EncryptStorage // *StorageAction_EncryptShareStorage // *StorageAction_EncryptAdd Value isStorageAction_Value `protobuf_oneof:"value"` Ty int32 `protobuf:"varint,7,opt,name=ty,proto3" json:"ty,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*StorageAction) Descriptor ¶
func (*StorageAction) Descriptor() ([]byte, []int)
func (*StorageAction) GetContentStorage ¶
func (m *StorageAction) GetContentStorage() *ContentOnlyNotaryStorage
func (*StorageAction) GetEncryptAdd ¶
func (m *StorageAction) GetEncryptAdd() *EncryptNotaryAdd
func (*StorageAction) GetEncryptShareStorage ¶
func (m *StorageAction) GetEncryptShareStorage() *EncryptShareNotaryStorage
func (*StorageAction) GetEncryptStorage ¶
func (m *StorageAction) GetEncryptStorage() *EncryptNotaryStorage
func (*StorageAction) GetHashStorage ¶
func (m *StorageAction) GetHashStorage() *HashOnlyNotaryStorage
func (*StorageAction) GetLinkStorage ¶
func (m *StorageAction) GetLinkStorage() *LinkNotaryStorage
func (*StorageAction) GetTy ¶
func (m *StorageAction) GetTy() int32
func (*StorageAction) GetValue ¶
func (m *StorageAction) GetValue() isStorageAction_Value
func (*StorageAction) ProtoMessage ¶
func (*StorageAction) ProtoMessage()
func (*StorageAction) Reset ¶
func (m *StorageAction) Reset()
func (*StorageAction) String ¶
func (m *StorageAction) String() string
func (*StorageAction) XXX_DiscardUnknown ¶
func (m *StorageAction) XXX_DiscardUnknown()
func (*StorageAction) XXX_Marshal ¶
func (m *StorageAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*StorageAction) XXX_Merge ¶
func (m *StorageAction) XXX_Merge(src proto.Message)
func (*StorageAction) XXX_OneofWrappers ¶
func (*StorageAction) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*StorageAction) XXX_Size ¶
func (m *StorageAction) XXX_Size() int
func (*StorageAction) XXX_Unmarshal ¶
func (m *StorageAction) XXX_Unmarshal(b []byte) error
type StorageAction_ContentStorage ¶
type StorageAction_ContentStorage struct {
ContentStorage *ContentOnlyNotaryStorage `protobuf:"bytes,1,opt,name=contentStorage,proto3,oneof"`
}
type StorageAction_EncryptAdd ¶
type StorageAction_EncryptAdd struct {
EncryptAdd *EncryptNotaryAdd `protobuf:"bytes,6,opt,name=encryptAdd,proto3,oneof"`
}
type StorageAction_EncryptShareStorage ¶
type StorageAction_EncryptShareStorage struct {
}type StorageAction_EncryptStorage ¶
type StorageAction_EncryptStorage struct {
EncryptStorage *EncryptNotaryStorage `protobuf:"bytes,4,opt,name=encryptStorage,proto3,oneof"`
}
type StorageAction_HashStorage ¶
type StorageAction_HashStorage struct {
HashStorage *HashOnlyNotaryStorage `protobuf:"bytes,2,opt,name=hashStorage,proto3,oneof"`
}
type StorageAction_LinkStorage ¶
type StorageAction_LinkStorage struct {
LinkStorage *LinkNotaryStorage `protobuf:"bytes,3,opt,name=linkStorage,proto3,oneof"`
}
type StorageClient ¶
type StorageClient interface { }
StorageClient is the client API for Storage service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewStorageClient ¶
func NewStorageClient(cc grpc.ClientConnInterface) StorageClient
type StorageServer ¶
type StorageServer interface { }
StorageServer is the server API for Storage service.
type StorageType ¶
type StorageType struct {
types.ExecTypeBase
}
StorageType ...
func (*StorageType) GetLogMap ¶
func (s *StorageType) GetLogMap() map[int64]*types.LogInfo
GetLogMap 获取合约log相关信息
func (*StorageType) GetPayload ¶
func (s *StorageType) GetPayload() types.Message
GetPayload 获取合约action结构
func (*StorageType) GetTypeMap ¶
func (s *StorageType) GetTypeMap() map[string]int32
GetTypeMap 获取合约action的id和name信息
type Storage_ContentStorage ¶
type Storage_ContentStorage struct {
ContentStorage *ContentOnlyNotaryStorage `protobuf:"bytes,1,opt,name=contentStorage,proto3,oneof"`
}
type Storage_EncryptAdd ¶
type Storage_EncryptAdd struct {
EncryptAdd *EncryptNotaryAdd `protobuf:"bytes,6,opt,name=encryptAdd,proto3,oneof"`
}
type Storage_EncryptShareStorage ¶
type Storage_EncryptShareStorage struct {
}type Storage_EncryptStorage ¶
type Storage_EncryptStorage struct {
EncryptStorage *EncryptNotaryStorage `protobuf:"bytes,4,opt,name=encryptStorage,proto3,oneof"`
}
type Storage_HashStorage ¶
type Storage_HashStorage struct {
HashStorage *HashOnlyNotaryStorage `protobuf:"bytes,2,opt,name=hashStorage,proto3,oneof"`
}
type Storage_LinkStorage ¶
type Storage_LinkStorage struct {
LinkStorage *LinkNotaryStorage `protobuf:"bytes,3,opt,name=linkStorage,proto3,oneof"`
}
type UnimplementedStorageServer ¶
type UnimplementedStorageServer struct { }
UnimplementedStorageServer can be embedded to have forward compatible implementations.