config_erc20

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 27 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config_erc20 contains

  • chaincode methods names {service_name}Chaincode_{method_name}
  • chaincode interface definition {service_name}Chaincode
  • chaincode gateway definition {service_name}}Gateway
  • chaincode service to cckit router registration func

Package config_erc20 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (

	// ConfigERC20ServiceChaincodeMethodPrefix allows to use multiple services with same method names in one chaincode
	ConfigERC20ServiceChaincodeMethodPrefix = ""

	ConfigERC20ServiceChaincode_GetName = ConfigERC20ServiceChaincodeMethodPrefix + "GetName"

	ConfigERC20ServiceChaincode_GetSymbol = ConfigERC20ServiceChaincodeMethodPrefix + "GetSymbol"

	ConfigERC20ServiceChaincode_GetDecimals = ConfigERC20ServiceChaincodeMethodPrefix + "GetDecimals"

	ConfigERC20ServiceChaincode_GetTotalSupply = ConfigERC20ServiceChaincodeMethodPrefix + "GetTotalSupply"
)

ConfigERC20ServiceChaincode method names

Variables

View Source
var ConfigERC20ServiceSwagger []byte
View Source
var File_token_service_config_erc20_config_erc20_proto protoreflect.FileDescriptor

Functions

func RegisterConfigERC20ServiceChaincode

func RegisterConfigERC20ServiceChaincode(r *cckit_router.Group, cc ConfigERC20ServiceChaincode) error

RegisterConfigERC20ServiceChaincode registers service methods as chaincode router handlers

func RegisterConfigERC20ServiceHandler

func RegisterConfigERC20ServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterConfigERC20ServiceHandler registers the http handlers for service ConfigERC20Service to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterConfigERC20ServiceHandlerClient

func RegisterConfigERC20ServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ConfigERC20ServiceClient) error

RegisterConfigERC20ServiceHandlerClient registers the http handlers for service ConfigERC20Service to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ConfigERC20ServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ConfigERC20ServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ConfigERC20ServiceClient" to call the correct interceptors.

func RegisterConfigERC20ServiceHandlerFromEndpoint

func RegisterConfigERC20ServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterConfigERC20ServiceHandlerFromEndpoint is same as RegisterConfigERC20ServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterConfigERC20ServiceHandlerServer

func RegisterConfigERC20ServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ConfigERC20ServiceServer) error

RegisterConfigERC20ServiceHandlerServer registers the http handlers for service ConfigERC20Service to "mux". UnaryRPC :call ConfigERC20ServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterConfigERC20ServiceHandlerFromEndpoint instead.

func RegisterConfigERC20ServiceServer

func RegisterConfigERC20ServiceServer(s *grpc.Server, srv ConfigERC20ServiceServer)

Types

type ConfigERC20ServiceChaincode

type ConfigERC20ServiceChaincode interface {
	GetName(cckit_router.Context, *emptypb.Empty) (*NameResponse, error)

	GetSymbol(cckit_router.Context, *emptypb.Empty) (*SymbolResponse, error)

	GetDecimals(cckit_router.Context, *emptypb.Empty) (*DecimalsResponse, error)

	GetTotalSupply(cckit_router.Context, *emptypb.Empty) (*TotalSupplyResponse, error)
}

ConfigERC20ServiceChaincode chaincode methods interface

type ConfigERC20ServiceChaincodeLocalResolver

type ConfigERC20ServiceChaincodeLocalResolver struct {
	// contains filtered or unexported fields
}

ConfigERC20ServiceChaincodeResolver interface for service resolver

func (*ConfigERC20ServiceChaincodeLocalResolver) Resolve

type ConfigERC20ServiceChaincodeLocatorResolver

type ConfigERC20ServiceChaincodeLocatorResolver struct {
	// contains filtered or unexported fields
}

ConfigERC20ServiceChaincodeResolver interface for service resolver

func (*ConfigERC20ServiceChaincodeLocatorResolver) Resolve

type ConfigERC20ServiceChaincodeResolver

type ConfigERC20ServiceChaincodeResolver interface {
	Resolve(ctx cckit_router.Context) (ConfigERC20ServiceChaincode, error)
}

ConfigERC20ServiceChaincodeResolver interface for service resolver

type ConfigERC20ServiceChaincodeStubInvoker

type ConfigERC20ServiceChaincodeStubInvoker struct {
	Invoker cckit_gateway.ChaincodeStubInvoker
}

func (*ConfigERC20ServiceChaincodeStubInvoker) GetDecimals

func (*ConfigERC20ServiceChaincodeStubInvoker) GetName

func (*ConfigERC20ServiceChaincodeStubInvoker) GetSymbol

func (*ConfigERC20ServiceChaincodeStubInvoker) GetTotalSupply

type ConfigERC20ServiceClient

type ConfigERC20ServiceClient interface {
	// Returns the name of the token.
	GetName(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*NameResponse, error)
	// Returns the symbol of the token, usually a shorter version of the name.
	GetSymbol(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*SymbolResponse, error)
	// Returns the number of decimals used to get its user representation.
	// For example, if decimals equals 2, a balance of 505 tokens should be displayed to a user as 5,05 (505 / 10 ** 2).
	GetDecimals(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*DecimalsResponse, error)
	// Returns the amount of tokens in existence.
	GetTotalSupply(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*TotalSupplyResponse, error)
}

ConfigERC20ServiceClient is the client API for ConfigERC20Service service.

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

type ConfigERC20ServiceGateway

type ConfigERC20ServiceGateway struct {
	ChaincodeInstance cckit_gateway.ChaincodeInstance
}

gateway implementation gateway can be used as kind of SDK, GRPC or REST server ( via grpc-gateway or clay )

func NewConfigERC20ServiceGateway

func NewConfigERC20ServiceGateway(sdk cckit_sdk.SDK, channel, chaincode string, opts ...cckit_gateway.Opt) *ConfigERC20ServiceGateway

NewConfigERC20ServiceGateway creates gateway to access chaincode method via chaincode service

func NewConfigERC20ServiceGatewayFromInstance

func NewConfigERC20ServiceGatewayFromInstance(chaincodeInstance cckit_gateway.ChaincodeInstance) *ConfigERC20ServiceGateway

func (*ConfigERC20ServiceGateway) GetDecimals

func (*ConfigERC20ServiceGateway) GetName

func (*ConfigERC20ServiceGateway) GetSymbol

func (*ConfigERC20ServiceGateway) GetTotalSupply

func (*ConfigERC20ServiceGateway) Invoker

func (*ConfigERC20ServiceGateway) ServiceDef

ServiceDef returns service definition

type ConfigERC20ServiceServer

type ConfigERC20ServiceServer interface {
	// Returns the name of the token.
	GetName(context.Context, *emptypb.Empty) (*NameResponse, error)
	// Returns the symbol of the token, usually a shorter version of the name.
	GetSymbol(context.Context, *emptypb.Empty) (*SymbolResponse, error)
	// Returns the number of decimals used to get its user representation.
	// For example, if decimals equals 2, a balance of 505 tokens should be displayed to a user as 5,05 (505 / 10 ** 2).
	GetDecimals(context.Context, *emptypb.Empty) (*DecimalsResponse, error)
	// Returns the amount of tokens in existence.
	GetTotalSupply(context.Context, *emptypb.Empty) (*TotalSupplyResponse, error)
}

ConfigERC20ServiceServer is the server API for ConfigERC20Service service.

type DecimalsResponse

type DecimalsResponse struct {
	Decimals uint32 `protobuf:"varint,1,opt,name=decimals,proto3" json:"decimals,omitempty"`
	// contains filtered or unexported fields
}

func (*DecimalsResponse) Descriptor deprecated

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

Deprecated: Use DecimalsResponse.ProtoReflect.Descriptor instead.

func (*DecimalsResponse) GetDecimals

func (x *DecimalsResponse) GetDecimals() uint32

func (*DecimalsResponse) ProtoMessage

func (*DecimalsResponse) ProtoMessage()

func (*DecimalsResponse) ProtoReflect

func (x *DecimalsResponse) ProtoReflect() protoreflect.Message

func (*DecimalsResponse) Reset

func (x *DecimalsResponse) Reset()

func (*DecimalsResponse) String

func (x *DecimalsResponse) String() string

func (*DecimalsResponse) Validate

func (this *DecimalsResponse) Validate() error

type ERC20Service

type ERC20Service struct {
	Token config.TokenGetter
}

func (*ERC20Service) GetDecimals

func (s *ERC20Service) GetDecimals(ctx router.Context, e *emptypb.Empty) (*DecimalsResponse, error)

func (*ERC20Service) GetName

func (s *ERC20Service) GetName(ctx router.Context, e *emptypb.Empty) (*NameResponse, error)

func (*ERC20Service) GetSymbol

func (s *ERC20Service) GetSymbol(ctx router.Context, e *emptypb.Empty) (*SymbolResponse, error)

func (*ERC20Service) GetTotalSupply

func (s *ERC20Service) GetTotalSupply(ctx router.Context, e *emptypb.Empty) (*TotalSupplyResponse, error)

type NameResponse

type NameResponse struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*NameResponse) Descriptor deprecated

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

Deprecated: Use NameResponse.ProtoReflect.Descriptor instead.

func (*NameResponse) GetName

func (x *NameResponse) GetName() string

func (*NameResponse) ProtoMessage

func (*NameResponse) ProtoMessage()

func (*NameResponse) ProtoReflect

func (x *NameResponse) ProtoReflect() protoreflect.Message

func (*NameResponse) Reset

func (x *NameResponse) Reset()

func (*NameResponse) String

func (x *NameResponse) String() string

func (*NameResponse) Validate

func (this *NameResponse) Validate() error

type SymbolResponse

type SymbolResponse struct {
	Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
	// contains filtered or unexported fields
}

func (*SymbolResponse) Descriptor deprecated

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

Deprecated: Use SymbolResponse.ProtoReflect.Descriptor instead.

func (*SymbolResponse) GetSymbol

func (x *SymbolResponse) GetSymbol() string

func (*SymbolResponse) ProtoMessage

func (*SymbolResponse) ProtoMessage()

func (*SymbolResponse) ProtoReflect

func (x *SymbolResponse) ProtoReflect() protoreflect.Message

func (*SymbolResponse) Reset

func (x *SymbolResponse) Reset()

func (*SymbolResponse) String

func (x *SymbolResponse) String() string

func (*SymbolResponse) Validate

func (this *SymbolResponse) Validate() error

type TotalSupplyResponse

type TotalSupplyResponse struct {
	TotalSupply uint64 `protobuf:"varint,1,opt,name=total_supply,json=totalSupply,proto3" json:"total_supply,omitempty"`
	// contains filtered or unexported fields
}

func (*TotalSupplyResponse) Descriptor deprecated

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

Deprecated: Use TotalSupplyResponse.ProtoReflect.Descriptor instead.

func (*TotalSupplyResponse) GetTotalSupply

func (x *TotalSupplyResponse) GetTotalSupply() uint64

func (*TotalSupplyResponse) ProtoMessage

func (*TotalSupplyResponse) ProtoMessage()

func (*TotalSupplyResponse) ProtoReflect

func (x *TotalSupplyResponse) ProtoReflect() protoreflect.Message

func (*TotalSupplyResponse) Reset

func (x *TotalSupplyResponse) Reset()

func (*TotalSupplyResponse) String

func (x *TotalSupplyResponse) String() string

func (*TotalSupplyResponse) Validate

func (this *TotalSupplyResponse) Validate() error

type UnimplementedConfigERC20ServiceServer

type UnimplementedConfigERC20ServiceServer struct {
}

UnimplementedConfigERC20ServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedConfigERC20ServiceServer) GetDecimals

func (*UnimplementedConfigERC20ServiceServer) GetName

func (*UnimplementedConfigERC20ServiceServer) GetSymbol

func (*UnimplementedConfigERC20ServiceServer) GetTotalSupply

Jump to

Keyboard shortcuts

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