Documentation ¶
Index ¶
- Constants
- Variables
- func BytesToInt32(bytes []byte) int32
- func Convert(fc interface{}) interface{}
- func DataStringToBytes(str string, sep string) [][]byte
- func DecompressJar(filepath string) ([]byte, error)
- func GenPayload(beanAbi *BeanAbi, params ...interface{}) ([]byte, error)
- func GetLdbConfig() *opt.Options
- func GetLdbDefaultConfig() *opt.Options
- func InitContract(contractCode []byte)
- func IntToBytes2(i int) [2]byte
- func IntToBytes4(i int) [4]byte
- func IsBaseType(class string) bool
- func IsPrimitiveType(class string) bool
- func OpenDB(path string) *leveldb.DB
- func ParseContractData(contract *ObjectType, classFile *classfile.ClassFile, contractAddress string, ...)
- func ParseHistoryData(contract *ObjectType, classFile *classfile.ClassFile, contractAddress string, ...)
- func ParseIncrementData(contract *ObjectType, classFile *classfile.ClassFile, ...)
- func ReadJar(path string) (string, error)
- func ReadZipFile(zipf *zip.File) ([]byte, error)
- func Reset()
- type Abi
- type ArrayType
- type BaseType
- type BeanAbi
- type BeanType
- type Body
- type CommonType
- type Entry
- type FieldType
- type HvmLog
- type HyperList
- type HyperMap
- type HyperTable
- type KVTemplate
- type ListData
- type ObjectType
- type ParamBuilder
- func (p *ParamBuilder) AddBoolean(s bool) *ParamBuilder
- func (p *ParamBuilder) AddByte(s byte) *ParamBuilder
- func (p *ParamBuilder) AddCharacter(s uint16) *ParamBuilder
- func (p *ParamBuilder) AddDouble(s float64) *ParamBuilder
- func (p *ParamBuilder) AddFloat(s float32) *ParamBuilder
- func (p *ParamBuilder) AddInteger(s int) *ParamBuilder
- func (p *ParamBuilder) AddLong(s int64) *ParamBuilder
- func (p *ParamBuilder) AddObject(clazz string, s interface{}) *ParamBuilder
- func (p *ParamBuilder) AddShort(s int16) *ParamBuilder
- func (p *ParamBuilder) AddString(s string) *ParamBuilder
- func (p *ParamBuilder) Addbool(s bool) *ParamBuilder
- func (p *ParamBuilder) Addbyte(s byte) *ParamBuilder
- func (p *ParamBuilder) Addchar(s uint16) *ParamBuilder
- func (p *ParamBuilder) Adddouble(s float64) *ParamBuilder
- func (p *ParamBuilder) Addfloat(s float32) *ParamBuilder
- func (p *ParamBuilder) Addint(s int) *ParamBuilder
- func (p *ParamBuilder) Addlong(s int64) *ParamBuilder
- func (p *ParamBuilder) Addshort(s int16) *ParamBuilder
- func (p *ParamBuilder) Build() []byte
- func (p *ParamBuilder) CreateMethod(s string) *ParamBuilder
- type PayLoad
- type TableItem
- type Type
- type Version
Constants ¶
View Source
const ( ObjINT = "java.lang.Integer" INT = "int" ObjSHORT = "java.lang.Short" SHORT = "short" ObjLONG = "java.lang.Long" LONG = "long" ObjBYTE = "java.lang.Byte" BYTE = "byte" ObjFLOAT = "java.lang.Float" FLOAT = "float" ObjDOUBLE = "java.lang.Double" DOUBLE = "double" ObjCHAR = "java.lang.Character" CHAR = "char" ObjBOOL = "java.lang.Boolean" BOOL = "boolean" STRING = "java.lang.String" OBJECT = "java.lang.Object" )
View Source
const ( HyperListClassRef = "cn/hyperchain/core/HyperList" HyperListFieldRef = "Lcn/hyperchain/core/HyperList;" HyperMapClassRef = "cn/hyperchain/core/HyperMap" HyperMapFieldRef = "Lcn/hyperchain/core/HyperMap;" HyperTableClassRef = "cn/hyperchain/core/HyperTable" HyperTableFieldRef = "Lcn/hyperchain/core/HyperTable;" IntegerJ = "Ljava/lang/Integer;" BooleanJ = "Ljava/lang/Boolean;" ByteJ = "Ljava/lang/Byte;" CharacterJ = "Ljava/lang/Character;" DoubleJ = "Ljava/lang/Double;" FloatJ = "Ljava/lang/Float;" LongJ = "Ljava/lang/Long;" ShortJ = "Ljava/lang/Short;" StringJ = "Ljava/lang/String;" NULL = "null" )
View Source
const ( ContractManifestPath = "META-INF/MANIFEST.MF" ContractClassSuffix = ".class" )
Variables ¶
View Source
var ( NameAndType = []string{"name", "type", "value"} Contract *ObjectType ClassMap map[string]*classfile.ClassFile MainClass string DBStorage *leveldb.DB )
Functions ¶
func BytesToInt32 ¶
func DataStringToBytes ¶
func DecompressJar ¶
func GenPayload ¶
func GetLdbConfig ¶
func GetLdbDefaultConfig ¶
func InitContract ¶
func InitContract(contractCode []byte)
func IntToBytes2 ¶
func IntToBytes4 ¶
IntToBytes4 convert int to [4]byte NOTE: i should less than 2^31
func IsBaseType ¶
func IsPrimitiveType ¶
func ParseContractData ¶
func ParseHistoryData ¶
func ParseHistoryData(contract *ObjectType, classFile *classfile.ClassFile, contractAddress string, dbPath string)
func ParseIncrementData ¶
func ParseIncrementData(contract *ObjectType, classFile *classfile.ClassFile, contractAddress, mqLog string)
func ReadZipFile ¶
ReadZipFile read a file data from a zip
Types ¶
type ArrayType ¶
type ArrayType struct { CommonType Dimension int Fields []FieldType }
type BaseType ¶
type BaseType struct {
CommonType
}
type FieldType ¶
type FieldType interface { }
func NewFieldType ¶
NewFieldType create FieldType with class name
type HyperList ¶
type HyperList struct { CommonType Fields []FieldType // contains filtered or unexported fields }
type HyperMap ¶
type HyperMap struct { CommonType KFields []FieldType VFields []FieldType }
type HyperTable ¶
type HyperTable struct { CommonType Columns map[string]map[string]bool Items []TableItem }
type KVTemplate ¶
type ObjectType ¶
type ObjectType struct { CommonType Fields []FieldType }
type ParamBuilder ¶
type ParamBuilder struct {
// contains filtered or unexported fields
}
func NewParamBuilder ¶
func NewParamBuilder(s string) *ParamBuilder
func (*ParamBuilder) AddBoolean ¶
func (p *ParamBuilder) AddBoolean(s bool) *ParamBuilder
func (*ParamBuilder) AddByte ¶
func (p *ParamBuilder) AddByte(s byte) *ParamBuilder
func (*ParamBuilder) AddCharacter ¶
func (p *ParamBuilder) AddCharacter(s uint16) *ParamBuilder
func (*ParamBuilder) AddDouble ¶
func (p *ParamBuilder) AddDouble(s float64) *ParamBuilder
func (*ParamBuilder) AddFloat ¶
func (p *ParamBuilder) AddFloat(s float32) *ParamBuilder
func (*ParamBuilder) AddInteger ¶
func (p *ParamBuilder) AddInteger(s int) *ParamBuilder
func (*ParamBuilder) AddLong ¶
func (p *ParamBuilder) AddLong(s int64) *ParamBuilder
func (*ParamBuilder) AddObject ¶
func (p *ParamBuilder) AddObject(clazz string, s interface{}) *ParamBuilder
func (*ParamBuilder) AddShort ¶
func (p *ParamBuilder) AddShort(s int16) *ParamBuilder
func (*ParamBuilder) AddString ¶
func (p *ParamBuilder) AddString(s string) *ParamBuilder
func (*ParamBuilder) Addbool ¶
func (p *ParamBuilder) Addbool(s bool) *ParamBuilder
func (*ParamBuilder) Addbyte ¶
func (p *ParamBuilder) Addbyte(s byte) *ParamBuilder
func (*ParamBuilder) Addchar ¶
func (p *ParamBuilder) Addchar(s uint16) *ParamBuilder
func (*ParamBuilder) Adddouble ¶
func (p *ParamBuilder) Adddouble(s float64) *ParamBuilder
func (*ParamBuilder) Addfloat ¶
func (p *ParamBuilder) Addfloat(s float32) *ParamBuilder
func (*ParamBuilder) Addint ¶
func (p *ParamBuilder) Addint(s int) *ParamBuilder
func (*ParamBuilder) Addlong ¶
func (p *ParamBuilder) Addlong(s int64) *ParamBuilder
func (*ParamBuilder) Addshort ¶
func (p *ParamBuilder) Addshort(s int16) *ParamBuilder
func (*ParamBuilder) Build ¶
func (p *ParamBuilder) Build() []byte
func (*ParamBuilder) CreateMethod ¶
func (p *ParamBuilder) CreateMethod(s string) *ParamBuilder
type PayLoad ¶ added in v1.1.0
type PayLoad struct { InvokeBeanName string `json:"invokeBeanName"` InvokeArgs string `json:"invokeArgs"` InvokeMethods []string `json:"invokeMethods"` }
func DecodePayload ¶ added in v1.1.0
Click to show internal directories.
Click to hide internal directories.