Documentation ¶
Index ¶
- Constants
- func AdminDbSet(owner interface{}, chain uint64, key, value []byte, life uint64) error
- func DbExist(owner interface{}, chain uint64, key []byte) bool
- func DbGet(owner interface{}, chain uint64, key []byte) ([]byte, uint64)
- func Decode(in []byte, out interface{}) int
- func Encode(in interface{}) []byte
- func GetAppName(owner interface{}) []byte
- func GetFullPathOfApp(chain uint64, name []byte) string
- func GetHash(in []byte) []byte
- func GetNextKey(chain uint64, isDb bool, appName, structName string, preKey []byte) []byte
- func GetPackPath(chain uint64, name []byte) string
- func GetStructName(owner interface{}) []byte
- func GetValue(chain uint64, isDb bool, appName, structName string, key []byte) ([]byte, uint64)
- func GobDecode(in []byte, out interface{}) int
- func GobEncode(in interface{}) []byte
- func JSONDecode(in []byte, out interface{}) int
- func JSONEncode(in interface{}) []byte
- func LogRead(owner interface{}, chain uint64, key []byte) ([]byte, uint64)
- func NewApp(chain uint64, name []byte, code []byte)
- func RebuildApp(chain uint64, dir string) error
- func RunApp(client *client.Client, flag []byte, chain uint64, mode string, ...)
- type EventFilter
- type TAppInfo
- type TAppNewHead
- type TAppNewInfo
- type TDependItem
- type TRunParam
- type TRuntime
- func (r *TRuntime) ConsumeEnergy(energy uint64)
- func (r *TRuntime) DbGet(owner interface{}, key []byte) ([]byte, uint64)
- func (r *TRuntime) DbGetLife(owner interface{}, key []byte) uint64
- func (r *TRuntime) DbSet(owner interface{}, key, value []byte, life uint64)
- func (r *TRuntime) Decode(typ uint8, in []byte, out interface{}) int
- func (r *TRuntime) Encode(typ uint8, in interface{}) []byte
- func (r *TRuntime) Event(user interface{}, event string, param ...[]byte)
- func (r *TRuntime) GetAppName(owner interface{}) []byte
- func (r *TRuntime) GetHash(in []byte) []byte
- func (r *TRuntime) JSONDecode(in []byte, out interface{})
- func (r *TRuntime) JSONEncode(in interface{}) []byte
- func (r *TRuntime) LogRead(owner interface{}, chain uint64, key []byte) ([]byte, uint64)
- func (r *TRuntime) LogReadLife(owner interface{}, key []byte) uint64
- func (r *TRuntime) LogWrite(owner interface{}, key, value []byte, life uint64)
- func (r *TRuntime) NewApp(name []byte, code []byte)
- func (r *TRuntime) OtherOps(user interface{}, ops int, data []byte) []byte
- func (r *TRuntime) Recover(address, sign, msg []byte) bool
- func (r *TRuntime) RunApp(name, user, data []byte, energy, cost uint64)
- func (r *TRuntime) SetInfo(chain uint64, flag []byte)
- func (r *TRuntime) SetTestMode()
Constants ¶
View Source
const ( // AppFlagRun the app can be call AppFlagRun = uint8(1 << iota) // AppFlagImport the app code can be included AppFlagImport // AppFlagPlublc App funds address uses the plublc address, except for app, others have no right to operate the address. AppFlagPlublc // AppFlagGzipCompress gzip compress AppFlagGzipCompress // AppFlagEnd end of flag AppFlagEnd )
View Source
const ( EncBinary = uint8(iota) EncJSON EncGob )
encoding type
Variables ¶
This section is empty.
Functions ¶
func AdminDbSet ¶
AdminDbSet write data to the chain
func GetAppName ¶ added in v0.3.2
func GetAppName(owner interface{}) []byte
GetAppName 用app的私有结构体,获取app的Hash名字
func GetFullPathOfApp ¶
GetFullPathOfApp get the full path of app
func GetNextKey ¶ added in v0.3.2
GetNextKey get next key
func GetPackPath ¶
GetPackPath get the package path on golang packages
func JSONDecode ¶ added in v0.3.2
JSONDecode decode json
func RebuildApp ¶ added in v0.3.9
RebuildApp rebuild app
Types ¶
type EventFilter ¶
type EventFilter struct {
// contains filtered or unexported fields
}
EventFilter event filter, show or drop app event
type TAppNewHead ¶
TAppNewHead 新建app的头消息,不包含依赖列表
type TAppNewInfo ¶
type TAppNewInfo struct { TAppNewHead Depends []TDependItem }
TAppNewInfo 新建app的信息,不包含依赖列表
type TRunParam ¶
type TRunParam struct { Chain uint64 Flag []byte User []byte Data []byte Cost uint64 Energy uint64 ErrorInfo string }
TRunParam Run接口的入参
type TRuntime ¶
TRuntime 执行机的结构体定义
func NewRuntime ¶ added in v0.3.9
NewRuntime input address of database
func (*TRuntime) ConsumeEnergy ¶
ConsumeEnergy consume energy
func (*TRuntime) GetAppName ¶
GetAppName 用app的私有结构体,获取app的Hash名字
func (*TRuntime) JSONDecode ¶
JSONDecode 将json格式的字符串转成结构体
func (*TRuntime) JSONEncode ¶
JSONEncode 将结构体转成json格式的字符串
func (*TRuntime) LogReadLife ¶
LogReadLife get life of the log data
func (*TRuntime) SetTestMode ¶ added in v0.3.2
func (r *TRuntime) SetTestMode()
SetTestMode set test mode,it will not write data to database
Click to show internal directories.
Click to hide internal directories.