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
- Variables
- func RegisterConfigERC20ServiceChaincode(r *cckit_router.Group, cc ConfigERC20ServiceChaincode) error
- func RegisterConfigERC20ServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterConfigERC20ServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ConfigERC20ServiceClient) error
- func RegisterConfigERC20ServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterConfigERC20ServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ConfigERC20ServiceServer) error
- func RegisterConfigERC20ServiceServer(s *grpc.Server, srv ConfigERC20ServiceServer)
- type ConfigERC20ServiceChaincode
- type ConfigERC20ServiceChaincodeLocalResolver
- type ConfigERC20ServiceChaincodeLocatorResolver
- type ConfigERC20ServiceChaincodeResolver
- type ConfigERC20ServiceChaincodeStubInvoker
- func (c *ConfigERC20ServiceChaincodeStubInvoker) GetDecimals(ctx cckit_router.Context, in *emptypb.Empty) (*DecimalsResponse, error)
- func (c *ConfigERC20ServiceChaincodeStubInvoker) GetName(ctx cckit_router.Context, in *emptypb.Empty) (*NameResponse, error)
- func (c *ConfigERC20ServiceChaincodeStubInvoker) GetSymbol(ctx cckit_router.Context, in *emptypb.Empty) (*SymbolResponse, error)
- func (c *ConfigERC20ServiceChaincodeStubInvoker) GetTotalSupply(ctx cckit_router.Context, in *emptypb.Empty) (*TotalSupplyResponse, error)
- type ConfigERC20ServiceClient
- type ConfigERC20ServiceGateway
- func (c *ConfigERC20ServiceGateway) GetDecimals(ctx context.Context, in *emptypb.Empty) (*DecimalsResponse, error)
- func (c *ConfigERC20ServiceGateway) GetName(ctx context.Context, in *emptypb.Empty) (*NameResponse, error)
- func (c *ConfigERC20ServiceGateway) GetSymbol(ctx context.Context, in *emptypb.Empty) (*SymbolResponse, error)
- func (c *ConfigERC20ServiceGateway) GetTotalSupply(ctx context.Context, in *emptypb.Empty) (*TotalSupplyResponse, error)
- func (c *ConfigERC20ServiceGateway) Invoker() cckit_gateway.ChaincodeInstanceInvoker
- func (c *ConfigERC20ServiceGateway) ServiceDef() cckit_gateway.ServiceDef
- type ConfigERC20ServiceServer
- type DecimalsResponse
- func (*DecimalsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DecimalsResponse) GetDecimals() uint32
- func (*DecimalsResponse) ProtoMessage()
- func (x *DecimalsResponse) ProtoReflect() protoreflect.Message
- func (x *DecimalsResponse) Reset()
- func (x *DecimalsResponse) String() string
- func (this *DecimalsResponse) Validate() error
- type ERC20Service
- func (s *ERC20Service) GetDecimals(ctx router.Context, e *emptypb.Empty) (*DecimalsResponse, error)
- func (s *ERC20Service) GetName(ctx router.Context, e *emptypb.Empty) (*NameResponse, error)
- func (s *ERC20Service) GetSymbol(ctx router.Context, e *emptypb.Empty) (*SymbolResponse, error)
- func (s *ERC20Service) GetTotalSupply(ctx router.Context, e *emptypb.Empty) (*TotalSupplyResponse, error)
- type NameResponse
- func (*NameResponse) Descriptor() ([]byte, []int)deprecated
- func (x *NameResponse) GetName() string
- func (*NameResponse) ProtoMessage()
- func (x *NameResponse) ProtoReflect() protoreflect.Message
- func (x *NameResponse) Reset()
- func (x *NameResponse) String() string
- func (this *NameResponse) Validate() error
- type SymbolResponse
- func (*SymbolResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SymbolResponse) GetSymbol() string
- func (*SymbolResponse) ProtoMessage()
- func (x *SymbolResponse) ProtoReflect() protoreflect.Message
- func (x *SymbolResponse) Reset()
- func (x *SymbolResponse) String() string
- func (this *SymbolResponse) Validate() error
- type TotalSupplyResponse
- func (*TotalSupplyResponse) Descriptor() ([]byte, []int)deprecated
- func (x *TotalSupplyResponse) GetTotalSupply() uint64
- func (*TotalSupplyResponse) ProtoMessage()
- func (x *TotalSupplyResponse) ProtoReflect() protoreflect.Message
- func (x *TotalSupplyResponse) Reset()
- func (x *TotalSupplyResponse) String() string
- func (this *TotalSupplyResponse) Validate() error
- type UnimplementedConfigERC20ServiceServer
- func (*UnimplementedConfigERC20ServiceServer) GetDecimals(context.Context, *emptypb.Empty) (*DecimalsResponse, error)
- func (*UnimplementedConfigERC20ServiceServer) GetName(context.Context, *emptypb.Empty) (*NameResponse, error)
- func (*UnimplementedConfigERC20ServiceServer) GetSymbol(context.Context, *emptypb.Empty) (*SymbolResponse, error)
- func (*UnimplementedConfigERC20ServiceServer) GetTotalSupply(context.Context, *emptypb.Empty) (*TotalSupplyResponse, error)
Constants ¶
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 ¶
var ConfigERC20ServiceSwagger []byte
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 NewConfigERC20ServiceChaincodeLocalResolver ¶
func NewConfigERC20ServiceChaincodeLocalResolver(service ConfigERC20ServiceChaincode) *ConfigERC20ServiceChaincodeLocalResolver
func (*ConfigERC20ServiceChaincodeLocalResolver) Resolve ¶
func (r *ConfigERC20ServiceChaincodeLocalResolver) Resolve(ctx cckit_router.Context) (ConfigERC20ServiceChaincode, error)
type ConfigERC20ServiceChaincodeLocatorResolver ¶
type ConfigERC20ServiceChaincodeLocatorResolver struct {
// contains filtered or unexported fields
}
ConfigERC20ServiceChaincodeResolver interface for service resolver
func NewConfigERC20ServiceChaincodeResolver ¶
func NewConfigERC20ServiceChaincodeResolver(locatorResolver cckit_gateway.ChaincodeLocatorResolver) *ConfigERC20ServiceChaincodeLocatorResolver
func (*ConfigERC20ServiceChaincodeLocatorResolver) Resolve ¶
func (r *ConfigERC20ServiceChaincodeLocatorResolver) Resolve(ctx cckit_router.Context) (ConfigERC20ServiceChaincode, error)
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 NewConfigERC20ServiceChaincodeStubInvoker ¶
func NewConfigERC20ServiceChaincodeStubInvoker(locator *cckit_gateway.ChaincodeLocator) *ConfigERC20ServiceChaincodeStubInvoker
func (*ConfigERC20ServiceChaincodeStubInvoker) GetDecimals ¶
func (c *ConfigERC20ServiceChaincodeStubInvoker) GetDecimals(ctx cckit_router.Context, in *emptypb.Empty) (*DecimalsResponse, error)
func (*ConfigERC20ServiceChaincodeStubInvoker) GetName ¶
func (c *ConfigERC20ServiceChaincodeStubInvoker) GetName(ctx cckit_router.Context, in *emptypb.Empty) (*NameResponse, error)
func (*ConfigERC20ServiceChaincodeStubInvoker) GetSymbol ¶
func (c *ConfigERC20ServiceChaincodeStubInvoker) GetSymbol(ctx cckit_router.Context, in *emptypb.Empty) (*SymbolResponse, error)
func (*ConfigERC20ServiceChaincodeStubInvoker) GetTotalSupply ¶
func (c *ConfigERC20ServiceChaincodeStubInvoker) GetTotalSupply(ctx cckit_router.Context, in *emptypb.Empty) (*TotalSupplyResponse, error)
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.
func NewConfigERC20ServiceClient ¶
func NewConfigERC20ServiceClient(cc grpc.ClientConnInterface) ConfigERC20ServiceClient
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 (c *ConfigERC20ServiceGateway) GetDecimals(ctx context.Context, in *emptypb.Empty) (*DecimalsResponse, error)
func (*ConfigERC20ServiceGateway) GetName ¶
func (c *ConfigERC20ServiceGateway) GetName(ctx context.Context, in *emptypb.Empty) (*NameResponse, error)
func (*ConfigERC20ServiceGateway) GetSymbol ¶
func (c *ConfigERC20ServiceGateway) GetSymbol(ctx context.Context, in *emptypb.Empty) (*SymbolResponse, error)
func (*ConfigERC20ServiceGateway) GetTotalSupply ¶
func (c *ConfigERC20ServiceGateway) GetTotalSupply(ctx context.Context, in *emptypb.Empty) (*TotalSupplyResponse, error)
func (*ConfigERC20ServiceGateway) Invoker ¶
func (c *ConfigERC20ServiceGateway) Invoker() cckit_gateway.ChaincodeInstanceInvoker
func (*ConfigERC20ServiceGateway) ServiceDef ¶
func (c *ConfigERC20ServiceGateway) ServiceDef() cckit_gateway.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) GetDecimals(context.Context, *emptypb.Empty) (*DecimalsResponse, error)
func (*UnimplementedConfigERC20ServiceServer) GetName ¶
func (*UnimplementedConfigERC20ServiceServer) GetName(context.Context, *emptypb.Empty) (*NameResponse, error)
func (*UnimplementedConfigERC20ServiceServer) GetSymbol ¶
func (*UnimplementedConfigERC20ServiceServer) GetSymbol(context.Context, *emptypb.Empty) (*SymbolResponse, error)
func (*UnimplementedConfigERC20ServiceServer) GetTotalSupply ¶
func (*UnimplementedConfigERC20ServiceServer) GetTotalSupply(context.Context, *emptypb.Empty) (*TotalSupplyResponse, error)