grpc

package
v0.0.0-...-fb17963 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2018 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Copyright 2018 AMIS Technologies This file is part of the sol2proto

The sol2proto is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The sol2proto is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the sol2proto. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

View Source
var Empty = Message{
	Name: "Empty",
}
View Source
var MessagesTemplate string = `` /* 849-byte string literal not displayed */
View Source
var ServiceTemplate string = `` /* 350-byte string literal not displayed */
View Source
var TransactOptsReq = Message{
	Name: "TransactOpts",
	Args: []Argument{
		{
			Name:    "private_key",
			IsSlice: false,
			Type:    "string",
		},
		{
			Name:    "nonce",
			IsSlice: false,
			Type:    "int64",
		},
		{
			Name:    "value",
			IsSlice: false,
			Type:    "int64",
		},
		{
			Name:    "gas_price",
			IsSlice: false,
			Type:    "int64",
		},
		{
			Name:    "gas_limit",
			IsSlice: false,
			Type:    "int64",
		},
	},
}
View Source
var TransactionReq = Message{
	Name: "TransactionReq",
	Args: []Argument{
		{
			Name:    "opts",
			Type:    TransactOptsReq.Name,
			IsSlice: false,
		},
	},
}
View Source
var TransactionResp = Message{
	Name: "TransactionResp",
	Args: []Argument{
		{
			Name:    "hash",
			IsSlice: false,
			Type:    "string",
		},
	},
}

Functions

func GenerateServiceProtoFile

func GenerateServiceProtoFile(srvName, pkgName string, contractABI abi.ABI, version string) (protoFile ProtoFile, msgs []Message)

Generate a renderable object and required message types from an Ethereum contract ABI

func ParseEvent

func ParseEvent(ev abi.Event) (Method, []Message)

Parse gRPC method and required message types from an Ethereum event.

func ParseEvents

func ParseEvents(abiEvents map[string]abi.Event) (methods Methods, msgs []Message)

Parse gRPC methods and required message types from events in an Ethereum contract ABI.

func ParseMethod

func ParseMethod(m abi.Method) (Method, []Message)

Parse gRPC method and required message types from an Ethereum contract method.

func ParseMethods

func ParseMethods(abiMethods map[string]abi.Method) (methods Methods, msgs []Message)

Parse gRPC methods and required message types from methods in an Ethereum contract ABI.

Types

type Argument

type Argument struct {
	Name    string
	Type    string
	IsSlice bool
}

func ToGrpcArgument

func ToGrpcArgument(in abi.Argument) Argument

func (Argument) String

func (arg Argument) String() string

type Message

type Message struct {
	Name string
	Args []Argument
}

func ToMessage

func ToMessage(name string, args []Argument) Message

func (Message) String

func (m Message) String() string

type MessageProtoFile

type MessageProtoFile struct {
	GeneratorVersion string
	Package          string
	Name             string
	Messages         Messages
	Sources          Sources
}

func GenerateMessageProtoFile

func GenerateMessageProtoFile(name, pkgName string, sources []string, messages []Message, version string) MessageProtoFile

Generate a renderable object from a list of messages

func (MessageProtoFile) Render

func (p MessageProtoFile) Render(writer io.WriteCloser) error

type Messages

type Messages []Message

func (Messages) Len

func (m Messages) Len() int

Len is part of sort.Interface.

func (Messages) Less

func (m Messages) Less(i, j int) bool

Less is part of sort.Interface. It is implemented by calling the "by" closure in the sorter.

func (Messages) Swap

func (m Messages) Swap(i, j int)

Swap is part of sort.Interface.

type Method

type Method struct {
	Const   bool
	Name    string
	Inputs  []Argument
	Outputs []Argument
}

func (Method) RequestName

func (m Method) RequestName() string

func (Method) ResponseName

func (m Method) ResponseName() string

func (Method) String

func (m Method) String() string

type Methods

type Methods []Method

func (Methods) Len

func (m Methods) Len() int

Len is part of sort.Interface.

func (Methods) Less

func (m Methods) Less(i, j int) bool

Less is part of sort.Interface. It is implemented by calling the "by" closure in the sorter.

func (Methods) Swap

func (m Methods) Swap(i, j int)

Swap is part of sort.Interface.

type ProtoFile

type ProtoFile struct {
	GeneratorVersion string
	Package          string
	Name             string
	Methods          Methods
	Events           Methods
	Sources          Sources
}

func (ProtoFile) Render

func (p ProtoFile) Render(writer io.WriteCloser) error

type Sources

type Sources []string

func (Sources) Len

func (s Sources) Len() int

Len is part of sort.Interface.

func (Sources) Less

func (s Sources) Less(i, j int) bool

Less is part of sort.Interface.

func (Sources) Swap

func (s Sources) Swap(i, j int)

Swap is part of sort.Interface.

Jump to

Keyboard shortcuts

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