echo

package
v1.67.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2023 License: BSD-3-Clause Imports: 11 Imported by: 16

Documentation

Overview

Package echo is a generated protocol buffer package.

It is generated from these files:

echo.proto

It has these top-level messages:

Ping
Pang
EchoAction
PingLog
PangLog
Query
QueryResult

Index

Constants

View Source
const (
	ActionPing = iota
	ActionPang
)

定义本执行器支持的Action种类

View Source
const (
	TyLogPing = 100001
	TyLogPang = 100002
)

定义本执行器生成的log类型

Variables

View Source
var (
	// EchoX 本执行器名称
	EchoX = "echo"
)

Functions

func InitExecutor

func InitExecutor(cfg *types.Chain33Config)

InitExecutor ...

func InitFork

func InitFork(cfg *types.Chain33Config)

InitFork ...

Types

type EchoAction

type EchoAction struct {
	// Types that are valid to be assigned to Value:
	//	*EchoAction_Ping
	//	*EchoAction_Pang
	Value isEchoAction_Value `protobuf_oneof:"value"`
	Ty    int32              `protobuf:"varint,3,opt,name=ty" json:"ty,omitempty"`
}

本执行器的统一Action结构

func (*EchoAction) Descriptor

func (*EchoAction) Descriptor() ([]byte, []int)

func (*EchoAction) GetPang

func (m *EchoAction) GetPang() *Pang

func (*EchoAction) GetPing

func (m *EchoAction) GetPing() *Ping

func (*EchoAction) GetTy

func (m *EchoAction) GetTy() int32

func (*EchoAction) GetValue

func (m *EchoAction) GetValue() isEchoAction_Value

func (*EchoAction) ProtoMessage

func (*EchoAction) ProtoMessage()

func (*EchoAction) Reset

func (m *EchoAction) Reset()

func (*EchoAction) String

func (m *EchoAction) String() string

func (*EchoAction) XXX_OneofFuncs

func (*EchoAction) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

type EchoAction_Pang

type EchoAction_Pang struct {
	Pang *Pang `protobuf:"bytes,2,opt,name=pang,oneof"`
}

type EchoAction_Ping

type EchoAction_Ping struct {
	Ping *Ping `protobuf:"bytes,1,opt,name=ping,oneof"`
}

type Pang

type Pang struct {
	Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"`
}

pang操作action

func (*Pang) Descriptor

func (*Pang) Descriptor() ([]byte, []int)

func (*Pang) GetMsg

func (m *Pang) GetMsg() string

func (*Pang) ProtoMessage

func (*Pang) ProtoMessage()

func (*Pang) Reset

func (m *Pang) Reset()

func (*Pang) String

func (m *Pang) String() string

type PangLog

type PangLog struct {
	Msg   string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"`
	Echo  string `protobuf:"bytes,2,opt,name=echo" json:"echo,omitempty"`
	Count int32  `protobuf:"varint,3,opt,name=count" json:"count,omitempty"`
}

pang操作生成的日志结构

func (*PangLog) Descriptor

func (*PangLog) Descriptor() ([]byte, []int)

func (*PangLog) GetCount

func (m *PangLog) GetCount() int32

func (*PangLog) GetEcho

func (m *PangLog) GetEcho() string

func (*PangLog) GetMsg

func (m *PangLog) GetMsg() string

func (*PangLog) ProtoMessage

func (*PangLog) ProtoMessage()

func (*PangLog) Reset

func (m *PangLog) Reset()

func (*PangLog) String

func (m *PangLog) String() string

type Ping

type Ping struct {
	Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"`
}

ping操作action

func (*Ping) Descriptor

func (*Ping) Descriptor() ([]byte, []int)

func (*Ping) GetMsg

func (m *Ping) GetMsg() string

func (*Ping) ProtoMessage

func (*Ping) ProtoMessage()

func (*Ping) Reset

func (m *Ping) Reset()

func (*Ping) String

func (m *Ping) String() string

type PingLog

type PingLog struct {
	Msg   string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"`
	Echo  string `protobuf:"bytes,2,opt,name=echo" json:"echo,omitempty"`
	Count int32  `protobuf:"varint,3,opt,name=count" json:"count,omitempty"`
}

ping操作生成的日志结构

func (*PingLog) Descriptor

func (*PingLog) Descriptor() ([]byte, []int)

func (*PingLog) GetCount

func (m *PingLog) GetCount() int32

func (*PingLog) GetEcho

func (m *PingLog) GetEcho() string

func (*PingLog) GetMsg

func (m *PingLog) GetMsg() string

func (*PingLog) ProtoMessage

func (*PingLog) ProtoMessage()

func (*PingLog) Reset

func (m *PingLog) Reset()

func (*PingLog) String

func (m *PingLog) String() string

type Query

type Query struct {
	Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"`
}

查询请求结构

func (*Query) Descriptor

func (*Query) Descriptor() ([]byte, []int)

func (*Query) GetMsg

func (m *Query) GetMsg() string

func (*Query) ProtoMessage

func (*Query) ProtoMessage()

func (*Query) Reset

func (m *Query) Reset()

func (*Query) String

func (m *Query) String() string

type QueryResult

type QueryResult struct {
	Msg   string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"`
	Count int32  `protobuf:"varint,2,opt,name=count" json:"count,omitempty"`
}

查询结果结构

func (*QueryResult) Descriptor

func (*QueryResult) Descriptor() ([]byte, []int)

func (*QueryResult) GetCount

func (m *QueryResult) GetCount() int32

func (*QueryResult) GetMsg

func (m *QueryResult) GetMsg() string

func (*QueryResult) ProtoMessage

func (*QueryResult) ProtoMessage()

func (*QueryResult) Reset

func (m *QueryResult) Reset()

func (*QueryResult) String

func (m *QueryResult) String() string

type Tx

type Tx struct {
	Message string `json:"msg"`
}

Tx echo 交易结构

type Type

type Type struct {
	types.ExecTypeBase
}

Type 定义本执行器类型

func NewType

func NewType(cfg *types.Chain33Config) *Type

NewType 初始化本执行器类型

func (*Type) CreateTx

func (e *Type) CreateTx(action string, message json.RawMessage) (*types.Transaction, error)

CreateTx 创建交易

func (*Type) GetLogMap

func (b *Type) GetLogMap() map[int64]*types.LogInfo

GetLogMap 返回本执行器的日志类型信息,用于rpc解析日志数据

func (*Type) GetName

func (b *Type) GetName() string

GetName 返回本执行器名称

func (*Type) GetPayload

func (b *Type) GetPayload() types.Message

GetPayload 返回本执行器的负载类型

func (*Type) GetTypeMap

func (b *Type) GetTypeMap() map[string]int32

GetTypeMap 返回本执行器中的action字典,支持双向查找

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL