contractcode

package
v0.0.0-...-2dd5fde Latest Latest
Warning

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

Go to latest
Published: May 2, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InfoMsg_MsgType_name = map[int32]string{
	0: "SUCESS",
	1: "ERROR",
}
View Source
var InfoMsg_MsgType_value = map[string]int32{
	"SUCESS": 0,
	"ERROR":  1,
}
View Source
var StateInfo_MsgType_name = map[int32]string{
	0: "SUCESS",
	1: "ERROR",
}
View Source
var StateInfo_MsgType_value = map[string]int32{
	"SUCESS": 0,
	"ERROR":  1,
}
View Source
var TransactionResponse_QueryType_name = map[int32]string{
	0: "GETSTATE",
	1: "PUTSTATE",
	2: "DELSTATE",
}
View Source
var TransactionResponse_QueryType_value = map[string]int32{
	"GETSTATE": 0,
	"PUTSTATE": 1,
	"DELSTATE": 2,
}

Functions

func RegisterContractServer

func RegisterContractServer(s *grpc.Server, srv ContractServer)

Types

type Cargo

type Cargo struct {
	Load                 []*TransactionResponse `protobuf:"bytes,1,rep,name=load,proto3" json:"load,omitempty"`
	XXX_NoUnkeyedLiteral struct{}               `json:"-"`
	XXX_unrecognized     []byte                 `json:"-"`
	XXX_sizecache        int32                  `json:"-"`
}

func (*Cargo) Descriptor

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

func (*Cargo) GetLoad

func (m *Cargo) GetLoad() []*TransactionResponse

func (*Cargo) ProtoMessage

func (*Cargo) ProtoMessage()

func (*Cargo) Reset

func (m *Cargo) Reset()

func (*Cargo) String

func (m *Cargo) String() string

func (*Cargo) XXX_DiscardUnknown

func (m *Cargo) XXX_DiscardUnknown()

func (*Cargo) XXX_Marshal

func (m *Cargo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Cargo) XXX_Merge

func (m *Cargo) XXX_Merge(src proto.Message)

func (*Cargo) XXX_Size

func (m *Cargo) XXX_Size() int

func (*Cargo) XXX_Unmarshal

func (m *Cargo) XXX_Unmarshal(b []byte) error

type ContractClient

type ContractClient interface {
	InitContract(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (Contract_InitContractClient, error)
	Invoke(ctx context.Context, in *ContractInfo, opts ...grpc.CallOption) (Contract_InvokeClient, error)
}

ContractClient is the client API for Contract service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewContractClient

func NewContractClient(cc *grpc.ClientConn) ContractClient

type ContractInfo

type ContractInfo struct {
	Transaction          string   `protobuf:"bytes,1,opt,name=Transaction,proto3" json:"Transaction,omitempty"`
	Args                 []string `protobuf:"bytes,2,rep,name=Args,proto3" json:"Args,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ContractInfo) Descriptor

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

func (*ContractInfo) GetArgs

func (m *ContractInfo) GetArgs() []string

func (*ContractInfo) GetTransaction

func (m *ContractInfo) GetTransaction() string

func (*ContractInfo) ProtoMessage

func (*ContractInfo) ProtoMessage()

func (*ContractInfo) Reset

func (m *ContractInfo) Reset()

func (*ContractInfo) String

func (m *ContractInfo) String() string

func (*ContractInfo) XXX_DiscardUnknown

func (m *ContractInfo) XXX_DiscardUnknown()

func (*ContractInfo) XXX_Marshal

func (m *ContractInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ContractInfo) XXX_Merge

func (m *ContractInfo) XXX_Merge(src proto.Message)

func (*ContractInfo) XXX_Size

func (m *ContractInfo) XXX_Size() int

func (*ContractInfo) XXX_Unmarshal

func (m *ContractInfo) XXX_Unmarshal(b []byte) error

type ContractServer

type ContractServer interface {
	InitContract(*empty.Empty, Contract_InitContractServer) error
	Invoke(*ContractInfo, Contract_InvokeServer) error
}

ContractServer is the server API for Contract service.

type Contract_InitContractClient

type Contract_InitContractClient interface {
	Recv() (*TransactionResponse, error)
	grpc.ClientStream
}

type Contract_InitContractServer

type Contract_InitContractServer interface {
	Send(*TransactionResponse) error
	grpc.ServerStream
}

type Contract_InvokeClient

type Contract_InvokeClient interface {
	Recv() (*TransactionResponse, error)
	grpc.ClientStream
}

type Contract_InvokeServer

type Contract_InvokeServer interface {
	Send(*TransactionResponse) error
	grpc.ServerStream
}

type DeleteState

type DeleteState struct {
	Key                  string   `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"`
	Version              string   `protobuf:"bytes,2,opt,name=Version,proto3" json:"Version,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DeleteState) Descriptor

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

func (*DeleteState) GetKey

func (m *DeleteState) GetKey() string

func (*DeleteState) GetVersion

func (m *DeleteState) GetVersion() string

func (*DeleteState) ProtoMessage

func (*DeleteState) ProtoMessage()

func (*DeleteState) Reset

func (m *DeleteState) Reset()

func (*DeleteState) String

func (m *DeleteState) String() string

func (*DeleteState) XXX_DiscardUnknown

func (m *DeleteState) XXX_DiscardUnknown()

func (*DeleteState) XXX_Marshal

func (m *DeleteState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeleteState) XXX_Merge

func (m *DeleteState) XXX_Merge(src proto.Message)

func (*DeleteState) XXX_Size

func (m *DeleteState) XXX_Size() int

func (*DeleteState) XXX_Unmarshal

func (m *DeleteState) XXX_Unmarshal(b []byte) error

type GetState

type GetState struct {
	Key                  string   `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"`
	Version              string   `protobuf:"bytes,2,opt,name=Version,proto3" json:"Version,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetState) Descriptor

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

func (*GetState) GetKey

func (m *GetState) GetKey() string

func (*GetState) GetVersion

func (m *GetState) GetVersion() string

func (*GetState) ProtoMessage

func (*GetState) ProtoMessage()

func (*GetState) Reset

func (m *GetState) Reset()

func (*GetState) String

func (m *GetState) String() string

func (*GetState) XXX_DiscardUnknown

func (m *GetState) XXX_DiscardUnknown()

func (*GetState) XXX_Marshal

func (m *GetState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetState) XXX_Merge

func (m *GetState) XXX_Merge(src proto.Message)

func (*GetState) XXX_Size

func (m *GetState) XXX_Size() int

func (*GetState) XXX_Unmarshal

func (m *GetState) XXX_Unmarshal(b []byte) error

type InfoMsg

type InfoMsg struct {
	Msg                  string          `protobuf:"bytes,1,opt,name=Msg,proto3" json:"Msg,omitempty"`
	Type                 InfoMsg_MsgType `protobuf:"varint,2,opt,name=type,proto3,enum=contractcode.InfoMsg_MsgType" json:"type,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

func (*InfoMsg) Descriptor

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

func (*InfoMsg) GetMsg

func (m *InfoMsg) GetMsg() string

func (*InfoMsg) GetType

func (m *InfoMsg) GetType() InfoMsg_MsgType

func (*InfoMsg) ProtoMessage

func (*InfoMsg) ProtoMessage()

func (*InfoMsg) Reset

func (m *InfoMsg) Reset()

func (*InfoMsg) String

func (m *InfoMsg) String() string

func (*InfoMsg) XXX_DiscardUnknown

func (m *InfoMsg) XXX_DiscardUnknown()

func (*InfoMsg) XXX_Marshal

func (m *InfoMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*InfoMsg) XXX_Merge

func (m *InfoMsg) XXX_Merge(src proto.Message)

func (*InfoMsg) XXX_Size

func (m *InfoMsg) XXX_Size() int

func (*InfoMsg) XXX_Unmarshal

func (m *InfoMsg) XXX_Unmarshal(b []byte) error

type InfoMsg_MsgType

type InfoMsg_MsgType int32
const (
	InfoMsg_SUCESS InfoMsg_MsgType = 0
	InfoMsg_ERROR  InfoMsg_MsgType = 1
)

func (InfoMsg_MsgType) EnumDescriptor

func (InfoMsg_MsgType) EnumDescriptor() ([]byte, []int)

func (InfoMsg_MsgType) String

func (x InfoMsg_MsgType) String() string

type PutState

type PutState struct {
	Id                   string       `protobuf:"bytes,1,opt,name=Id,proto3" json:"Id,omitempty"`
	Val                  []*ValueInfo `protobuf:"bytes,2,rep,name=Val,proto3" json:"Val,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func (*PutState) Descriptor

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

func (*PutState) GetId

func (m *PutState) GetId() string

func (*PutState) GetVal

func (m *PutState) GetVal() []*ValueInfo

func (*PutState) ProtoMessage

func (*PutState) ProtoMessage()

func (*PutState) Reset

func (m *PutState) Reset()

func (*PutState) String

func (m *PutState) String() string

func (*PutState) XXX_DiscardUnknown

func (m *PutState) XXX_DiscardUnknown()

func (*PutState) XXX_Marshal

func (m *PutState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PutState) XXX_Merge

func (m *PutState) XXX_Merge(src proto.Message)

func (*PutState) XXX_Size

func (m *PutState) XXX_Size() int

func (*PutState) XXX_Unmarshal

func (m *PutState) XXX_Unmarshal(b []byte) error

type Response

type Response struct {
	Result               *PutState `protobuf:"bytes,2,opt,name=Result,proto3" json:"Result,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*Response) Descriptor

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

func (*Response) GetResult

func (m *Response) GetResult() *PutState

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) Reset

func (m *Response) Reset()

func (*Response) String

func (m *Response) String() string

func (*Response) XXX_DiscardUnknown

func (m *Response) XXX_DiscardUnknown()

func (*Response) XXX_Marshal

func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Response) XXX_Merge

func (m *Response) XXX_Merge(src proto.Message)

func (*Response) XXX_Size

func (m *Response) XXX_Size() int

func (*Response) XXX_Unmarshal

func (m *Response) XXX_Unmarshal(b []byte) error

type StateInfo

type StateInfo struct {
	Msg                  StateInfo_MsgType `protobuf:"varint,1,opt,name=Msg,proto3,enum=contractcode.StateInfo_MsgType" json:"Msg,omitempty"`
	Payload              []byte            `protobuf:"bytes,2,opt,name=Payload,proto3" json:"Payload,omitempty"`
	Sign                 string            `protobuf:"bytes,3,opt,name=Sign,proto3" json:"Sign,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*StateInfo) Descriptor

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

func (*StateInfo) GetMsg

func (m *StateInfo) GetMsg() StateInfo_MsgType

func (*StateInfo) GetPayload

func (m *StateInfo) GetPayload() []byte

func (*StateInfo) GetSign

func (m *StateInfo) GetSign() string

func (*StateInfo) ProtoMessage

func (*StateInfo) ProtoMessage()

func (*StateInfo) Reset

func (m *StateInfo) Reset()

func (*StateInfo) String

func (m *StateInfo) String() string

func (*StateInfo) XXX_DiscardUnknown

func (m *StateInfo) XXX_DiscardUnknown()

func (*StateInfo) XXX_Marshal

func (m *StateInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StateInfo) XXX_Merge

func (m *StateInfo) XXX_Merge(src proto.Message)

func (*StateInfo) XXX_Size

func (m *StateInfo) XXX_Size() int

func (*StateInfo) XXX_Unmarshal

func (m *StateInfo) XXX_Unmarshal(b []byte) error

type StateInfo_MsgType

type StateInfo_MsgType int32
const (
	StateInfo_SUCESS StateInfo_MsgType = 0
	StateInfo_ERROR  StateInfo_MsgType = 1
)

func (StateInfo_MsgType) EnumDescriptor

func (StateInfo_MsgType) EnumDescriptor() ([]byte, []int)

func (StateInfo_MsgType) String

func (x StateInfo_MsgType) String() string

type TransactionResponse

type TransactionResponse struct {
	Query                TransactionResponse_QueryType `protobuf:"varint,1,opt,name=Query,proto3,enum=contractcode.TransactionResponse_QueryType" json:"Query,omitempty"`
	Payload              []byte                        `protobuf:"bytes,2,opt,name=Payload,proto3" json:"Payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                      `json:"-"`
	XXX_unrecognized     []byte                        `json:"-"`
	XXX_sizecache        int32                         `json:"-"`
}

func (*TransactionResponse) Descriptor

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

func (*TransactionResponse) GetPayload

func (m *TransactionResponse) GetPayload() []byte

func (*TransactionResponse) GetQuery

func (*TransactionResponse) ProtoMessage

func (*TransactionResponse) ProtoMessage()

func (*TransactionResponse) Reset

func (m *TransactionResponse) Reset()

func (*TransactionResponse) String

func (m *TransactionResponse) String() string

func (*TransactionResponse) XXX_DiscardUnknown

func (m *TransactionResponse) XXX_DiscardUnknown()

func (*TransactionResponse) XXX_Marshal

func (m *TransactionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TransactionResponse) XXX_Merge

func (m *TransactionResponse) XXX_Merge(src proto.Message)

func (*TransactionResponse) XXX_Size

func (m *TransactionResponse) XXX_Size() int

func (*TransactionResponse) XXX_Unmarshal

func (m *TransactionResponse) XXX_Unmarshal(b []byte) error

type TransactionResponse_QueryType

type TransactionResponse_QueryType int32
const (
	TransactionResponse_GETSTATE TransactionResponse_QueryType = 0
	TransactionResponse_PUTSTATE TransactionResponse_QueryType = 1
	TransactionResponse_DELSTATE TransactionResponse_QueryType = 2
)

func (TransactionResponse_QueryType) EnumDescriptor

func (TransactionResponse_QueryType) EnumDescriptor() ([]byte, []int)

func (TransactionResponse_QueryType) String

type TransferMessage

type TransferMessage struct {
	UserId               string   `protobuf:"bytes,1,opt,name=UserId,proto3" json:"UserId,omitempty"`
	FromAccId            string   `protobuf:"bytes,2,opt,name=FromAccId,proto3" json:"FromAccId,omitempty"`
	ToAccId              string   `protobuf:"bytes,3,opt,name=ToAccId,proto3" json:"ToAccId,omitempty"`
	Amount               int32    `protobuf:"varint,4,opt,name=Amount,proto3" json:"Amount,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*TransferMessage) Descriptor

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

func (*TransferMessage) GetAmount

func (m *TransferMessage) GetAmount() int32

func (*TransferMessage) GetFromAccId

func (m *TransferMessage) GetFromAccId() string

func (*TransferMessage) GetToAccId

func (m *TransferMessage) GetToAccId() string

func (*TransferMessage) GetUserId

func (m *TransferMessage) GetUserId() string

func (*TransferMessage) ProtoMessage

func (*TransferMessage) ProtoMessage()

func (*TransferMessage) Reset

func (m *TransferMessage) Reset()

func (*TransferMessage) String

func (m *TransferMessage) String() string

func (*TransferMessage) XXX_DiscardUnknown

func (m *TransferMessage) XXX_DiscardUnknown()

func (*TransferMessage) XXX_Marshal

func (m *TransferMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TransferMessage) XXX_Merge

func (m *TransferMessage) XXX_Merge(src proto.Message)

func (*TransferMessage) XXX_Size

func (m *TransferMessage) XXX_Size() int

func (*TransferMessage) XXX_Unmarshal

func (m *TransferMessage) XXX_Unmarshal(b []byte) error

type UserInfo

type UserInfo struct {
	UserId               string   `protobuf:"bytes,1,opt,name=UserId,proto3" json:"UserId,omitempty"`
	UserName             string   `protobuf:"bytes,2,opt,name=UserName,proto3" json:"UserName,omitempty"`
	Balance              int32    `protobuf:"varint,3,opt,name=Balance,proto3" json:"Balance,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*UserInfo) Descriptor

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

func (*UserInfo) GetBalance

func (m *UserInfo) GetBalance() int32

func (*UserInfo) GetUserId

func (m *UserInfo) GetUserId() string

func (*UserInfo) GetUserName

func (m *UserInfo) GetUserName() string

func (*UserInfo) ProtoMessage

func (*UserInfo) ProtoMessage()

func (*UserInfo) Reset

func (m *UserInfo) Reset()

func (*UserInfo) String

func (m *UserInfo) String() string

func (*UserInfo) XXX_DiscardUnknown

func (m *UserInfo) XXX_DiscardUnknown()

func (*UserInfo) XXX_Marshal

func (m *UserInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UserInfo) XXX_Merge

func (m *UserInfo) XXX_Merge(src proto.Message)

func (*UserInfo) XXX_Size

func (m *UserInfo) XXX_Size() int

func (*UserInfo) XXX_Unmarshal

func (m *UserInfo) XXX_Unmarshal(b []byte) error

type ValueInfo

type ValueInfo struct {
	Key                  string   `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"`
	Value                string   `protobuf:"bytes,2,opt,name=Value,proto3" json:"Value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ValueInfo) Descriptor

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

func (*ValueInfo) GetKey

func (m *ValueInfo) GetKey() string

func (*ValueInfo) GetValue

func (m *ValueInfo) GetValue() string

func (*ValueInfo) ProtoMessage

func (*ValueInfo) ProtoMessage()

func (*ValueInfo) Reset

func (m *ValueInfo) Reset()

func (*ValueInfo) String

func (m *ValueInfo) String() string

func (*ValueInfo) XXX_DiscardUnknown

func (m *ValueInfo) XXX_DiscardUnknown()

func (*ValueInfo) XXX_Marshal

func (m *ValueInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ValueInfo) XXX_Merge

func (m *ValueInfo) XXX_Merge(src proto.Message)

func (*ValueInfo) XXX_Size

func (m *ValueInfo) XXX_Size() int

func (*ValueInfo) XXX_Unmarshal

func (m *ValueInfo) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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