Documentation ¶
Overview ¶
Package faucetpb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterFaucetServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterFaucetServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client FaucetServiceClient) error
- func RegisterFaucetServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterFaucetServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server FaucetServiceServer) error
- func RegisterFaucetServiceServer(s grpc.ServiceRegistrar, srv FaucetServiceServer)
- type Chain
- type FaucetServiceClient
- type FaucetServiceServer
- type GetChainsRequest
- type GetChainsResponse
- type GiveMeRequest
- func (*GiveMeRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GiveMeRequest) GetAddress() string
- func (x *GiveMeRequest) GetChainId() string
- func (*GiveMeRequest) ProtoMessage()
- func (x *GiveMeRequest) ProtoReflect() protoreflect.Message
- func (x *GiveMeRequest) Reset()
- func (x *GiveMeRequest) String() string
- type GiveMeResponse
- type UnimplementedFaucetServiceServer
- type UnsafeFaucetServiceServer
- type User
Constants ¶
This section is empty.
Variables ¶
var FaucetService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "example.FaucetService", HandlerType: (*FaucetServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GiveMe", Handler: _FaucetService_GiveMe_Handler, }, { MethodName: "Chains", Handler: _FaucetService_Chains_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/faucetpb/faucet.proto", }
FaucetService_ServiceDesc is the grpc.ServiceDesc for FaucetService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_proto_faucetpb_faucet_proto protoreflect.FileDescriptor
Functions ¶
func RegisterFaucetServiceHandler ¶
func RegisterFaucetServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterFaucetServiceHandler registers the http handlers for service FaucetService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterFaucetServiceHandlerClient ¶
func RegisterFaucetServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client FaucetServiceClient) error
RegisterFaucetServiceHandlerClient registers the http handlers for service FaucetService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "FaucetServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "FaucetServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "FaucetServiceClient" to call the correct interceptors.
func RegisterFaucetServiceHandlerFromEndpoint ¶
func RegisterFaucetServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterFaucetServiceHandlerFromEndpoint is same as RegisterFaucetServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterFaucetServiceHandlerServer ¶
func RegisterFaucetServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server FaucetServiceServer) error
RegisterFaucetServiceHandlerServer registers the http handlers for service FaucetService to "mux". UnaryRPC :call FaucetServiceServer 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 RegisterFaucetServiceHandlerFromEndpoint instead.
func RegisterFaucetServiceServer ¶
func RegisterFaucetServiceServer(s grpc.ServiceRegistrar, srv FaucetServiceServer)
Types ¶
type Chain ¶
type Chain struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // contains filtered or unexported fields }
func (*Chain) Descriptor
deprecated
func (*Chain) GetChainId ¶
func (*Chain) ProtoMessage ¶
func (*Chain) ProtoMessage()
func (*Chain) ProtoReflect ¶
func (x *Chain) ProtoReflect() protoreflect.Message
type FaucetServiceClient ¶
type FaucetServiceClient interface { GiveMe(ctx context.Context, in *GiveMeRequest, opts ...grpc.CallOption) (*GiveMeResponse, error) Chains(ctx context.Context, in *GetChainsRequest, opts ...grpc.CallOption) (*GetChainsResponse, error) }
FaucetServiceClient is the client API for FaucetService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewFaucetServiceClient ¶
func NewFaucetServiceClient(cc grpc.ClientConnInterface) FaucetServiceClient
type FaucetServiceServer ¶
type FaucetServiceServer interface { GiveMe(context.Context, *GiveMeRequest) (*GiveMeResponse, error) Chains(context.Context, *GetChainsRequest) (*GetChainsResponse, error) // contains filtered or unexported methods }
FaucetServiceServer is the server API for FaucetService service. All implementations must embed UnimplementedFaucetServiceServer for forward compatibility
type GetChainsRequest ¶
type GetChainsRequest struct {
// contains filtered or unexported fields
}
func (*GetChainsRequest) Descriptor
deprecated
func (*GetChainsRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetChainsRequest.ProtoReflect.Descriptor instead.
func (*GetChainsRequest) ProtoMessage ¶
func (*GetChainsRequest) ProtoMessage()
func (*GetChainsRequest) ProtoReflect ¶
func (x *GetChainsRequest) ProtoReflect() protoreflect.Message
func (*GetChainsRequest) Reset ¶
func (x *GetChainsRequest) Reset()
func (*GetChainsRequest) String ¶
func (x *GetChainsRequest) String() string
type GetChainsResponse ¶
type GetChainsResponse struct { Chains []*Chain `protobuf:"bytes,1,rep,name=chains,proto3" json:"chains,omitempty"` // contains filtered or unexported fields }
func (*GetChainsResponse) Descriptor
deprecated
func (*GetChainsResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetChainsResponse.ProtoReflect.Descriptor instead.
func (*GetChainsResponse) GetChains ¶
func (x *GetChainsResponse) GetChains() []*Chain
func (*GetChainsResponse) ProtoMessage ¶
func (*GetChainsResponse) ProtoMessage()
func (*GetChainsResponse) ProtoReflect ¶
func (x *GetChainsResponse) ProtoReflect() protoreflect.Message
func (*GetChainsResponse) Reset ¶
func (x *GetChainsResponse) Reset()
func (*GetChainsResponse) String ¶
func (x *GetChainsResponse) String() string
type GiveMeRequest ¶
type GiveMeRequest struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // contains filtered or unexported fields }
func (*GiveMeRequest) Descriptor
deprecated
func (*GiveMeRequest) Descriptor() ([]byte, []int)
Deprecated: Use GiveMeRequest.ProtoReflect.Descriptor instead.
func (*GiveMeRequest) GetAddress ¶
func (x *GiveMeRequest) GetAddress() string
func (*GiveMeRequest) GetChainId ¶
func (x *GiveMeRequest) GetChainId() string
func (*GiveMeRequest) ProtoMessage ¶
func (*GiveMeRequest) ProtoMessage()
func (*GiveMeRequest) ProtoReflect ¶
func (x *GiveMeRequest) ProtoReflect() protoreflect.Message
func (*GiveMeRequest) Reset ¶
func (x *GiveMeRequest) Reset()
func (*GiveMeRequest) String ¶
func (x *GiveMeRequest) String() string
type GiveMeResponse ¶
type GiveMeResponse struct { TxHash string `protobuf:"bytes,1,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"` // contains filtered or unexported fields }
func (*GiveMeResponse) Descriptor
deprecated
func (*GiveMeResponse) Descriptor() ([]byte, []int)
Deprecated: Use GiveMeResponse.ProtoReflect.Descriptor instead.
func (*GiveMeResponse) GetTxHash ¶
func (x *GiveMeResponse) GetTxHash() string
func (*GiveMeResponse) ProtoMessage ¶
func (*GiveMeResponse) ProtoMessage()
func (*GiveMeResponse) ProtoReflect ¶
func (x *GiveMeResponse) ProtoReflect() protoreflect.Message
func (*GiveMeResponse) Reset ¶
func (x *GiveMeResponse) Reset()
func (*GiveMeResponse) String ¶
func (x *GiveMeResponse) String() string
type UnimplementedFaucetServiceServer ¶
type UnimplementedFaucetServiceServer struct { }
UnimplementedFaucetServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedFaucetServiceServer) Chains ¶
func (UnimplementedFaucetServiceServer) Chains(context.Context, *GetChainsRequest) (*GetChainsResponse, error)
func (UnimplementedFaucetServiceServer) GiveMe ¶
func (UnimplementedFaucetServiceServer) GiveMe(context.Context, *GiveMeRequest) (*GiveMeResponse, error)
type UnsafeFaucetServiceServer ¶
type UnsafeFaucetServiceServer interface {
// contains filtered or unexported methods
}
UnsafeFaucetServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to FaucetServiceServer will result in compilation errors.
type User ¶
type User struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message