faucet

package
v0.0.0-...-418b934 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Overview

Package faucet is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthFaucet        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowFaucet          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupFaucet = fmt.Errorf("proto: unexpected end of group")
)

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.

func RegisterFaucetServiceServer

func RegisterFaucetServiceServer(s *grpc.Server, srv FaucetServiceServer)

Types

type ClaimRequest

type ClaimRequest struct {
	Type                 Payment.CryptoType `protobuf:"varint,1,opt,name=Type,proto3,enum=payment.CryptoType" json:"Type,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

func (*ClaimRequest) Descriptor

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

func (*ClaimRequest) GetType

func (m *ClaimRequest) GetType() Payment.CryptoType

func (*ClaimRequest) Marshal

func (m *ClaimRequest) Marshal() (dAtA []byte, err error)

func (*ClaimRequest) MarshalTo

func (m *ClaimRequest) MarshalTo(dAtA []byte) (int, error)

func (*ClaimRequest) MarshalToSizedBuffer

func (m *ClaimRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ClaimRequest) ProtoMessage

func (*ClaimRequest) ProtoMessage()

func (*ClaimRequest) Reset

func (m *ClaimRequest) Reset()

func (*ClaimRequest) Size

func (m *ClaimRequest) Size() (n int)

func (*ClaimRequest) String

func (m *ClaimRequest) String() string

func (*ClaimRequest) Unmarshal

func (m *ClaimRequest) Unmarshal(dAtA []byte) error

func (*ClaimRequest) Validate

func (this *ClaimRequest) Validate() error

func (*ClaimRequest) XXX_DiscardUnknown

func (m *ClaimRequest) XXX_DiscardUnknown()

func (*ClaimRequest) XXX_Marshal

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

func (*ClaimRequest) XXX_Merge

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

func (*ClaimRequest) XXX_MessageName

func (*ClaimRequest) XXX_MessageName() string

func (*ClaimRequest) XXX_Size

func (m *ClaimRequest) XXX_Size() int

func (*ClaimRequest) XXX_Unmarshal

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

type EmptyRequest

type EmptyRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*EmptyRequest) Descriptor

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

func (*EmptyRequest) Marshal

func (m *EmptyRequest) Marshal() (dAtA []byte, err error)

func (*EmptyRequest) MarshalTo

func (m *EmptyRequest) MarshalTo(dAtA []byte) (int, error)

func (*EmptyRequest) MarshalToSizedBuffer

func (m *EmptyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*EmptyRequest) ProtoMessage

func (*EmptyRequest) ProtoMessage()

func (*EmptyRequest) Reset

func (m *EmptyRequest) Reset()

func (*EmptyRequest) Size

func (m *EmptyRequest) Size() (n int)

func (*EmptyRequest) String

func (m *EmptyRequest) String() string

func (*EmptyRequest) Unmarshal

func (m *EmptyRequest) Unmarshal(dAtA []byte) error

func (*EmptyRequest) Validate

func (this *EmptyRequest) Validate() error

func (*EmptyRequest) XXX_DiscardUnknown

func (m *EmptyRequest) XXX_DiscardUnknown()

func (*EmptyRequest) XXX_Marshal

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

func (*EmptyRequest) XXX_Merge

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

func (*EmptyRequest) XXX_MessageName

func (*EmptyRequest) XXX_MessageName() string

func (*EmptyRequest) XXX_Size

func (m *EmptyRequest) XXX_Size() int

func (*EmptyRequest) XXX_Unmarshal

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

type FaucetServiceClient

type FaucetServiceClient interface {
	GetPlayer(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*PlayerDTO, error)
	Claim(ctx context.Context, in *ClaimRequest, opts ...grpc.CallOption) (*ClaimRequest, error)
}

FaucetServiceClient is the client API for FaucetService service.

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

func NewFaucetServiceClient

func NewFaucetServiceClient(cc *grpc.ClientConn) FaucetServiceClient

type FaucetServiceServer

type FaucetServiceServer interface {
	GetPlayer(context.Context, *EmptyRequest) (*PlayerDTO, error)
	Claim(context.Context, *ClaimRequest) (*ClaimRequest, error)
}

FaucetServiceServer is the server API for FaucetService service.

type HistoryDTO

type HistoryDTO struct {
	Timestamp            *types.Timestamp `protobuf:"bytes,1,opt,name=Timestamp,proto3" json:"Timestamp,omitempty"`
	Amount               float64          `protobuf:"fixed64,2,opt,name=Amount,proto3" json:"Amount,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (*HistoryDTO) Descriptor

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

func (*HistoryDTO) GetAmount

func (m *HistoryDTO) GetAmount() float64

func (*HistoryDTO) GetTimestamp

func (m *HistoryDTO) GetTimestamp() *types.Timestamp

func (*HistoryDTO) Marshal

func (m *HistoryDTO) Marshal() (dAtA []byte, err error)

func (*HistoryDTO) MarshalTo

func (m *HistoryDTO) MarshalTo(dAtA []byte) (int, error)

func (*HistoryDTO) MarshalToSizedBuffer

func (m *HistoryDTO) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*HistoryDTO) ProtoMessage

func (*HistoryDTO) ProtoMessage()

func (*HistoryDTO) Reset

func (m *HistoryDTO) Reset()

func (*HistoryDTO) Size

func (m *HistoryDTO) Size() (n int)

func (*HistoryDTO) String

func (m *HistoryDTO) String() string

func (*HistoryDTO) Unmarshal

func (m *HistoryDTO) Unmarshal(dAtA []byte) error

func (*HistoryDTO) Validate

func (this *HistoryDTO) Validate() error

func (*HistoryDTO) XXX_DiscardUnknown

func (m *HistoryDTO) XXX_DiscardUnknown()

func (*HistoryDTO) XXX_Marshal

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

func (*HistoryDTO) XXX_Merge

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

func (*HistoryDTO) XXX_MessageName

func (*HistoryDTO) XXX_MessageName() string

func (*HistoryDTO) XXX_Size

func (m *HistoryDTO) XXX_Size() int

func (*HistoryDTO) XXX_Unmarshal

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

type PlayerDTO

type PlayerDTO struct {
	EntityID             string             `protobuf:"bytes,1,opt,name=EntityID,proto3" json:"EntityID,omitempty"`
	Type                 Payment.CryptoType `protobuf:"varint,2,opt,name=Type,proto3,enum=payment.CryptoType" json:"Type,omitempty"`
	ReferalID            uint64             `protobuf:"varint,3,opt,name=ReferalID,proto3" json:"ReferalID,omitempty"`
	LastClaim            *types.Timestamp   `protobuf:"bytes,11,opt,name=LastClaim,proto3" json:"LastClaim,omitempty"`
	BonusAmountPct       uint32             `protobuf:"varint,12,opt,name=BonusAmountPct,proto3" json:"BonusAmountPct,omitempty"`
	ReferalCount         uint64             `protobuf:"varint,31,opt,name=ReferalCount,proto3" json:"ReferalCount,omitempty"`
	ReferalClaimAmount   float64            `protobuf:"fixed64,32,opt,name=ReferalClaimAmount,proto3" json:"ReferalClaimAmount,omitempty"`
	Histories            []*HistoryDTO      `protobuf:"bytes,51,rep,name=Histories,proto3" json:"Histories,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

func (*PlayerDTO) Descriptor

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

func (*PlayerDTO) GetBonusAmountPct

func (m *PlayerDTO) GetBonusAmountPct() uint32

func (*PlayerDTO) GetEntityID

func (m *PlayerDTO) GetEntityID() string

func (*PlayerDTO) GetHistories

func (m *PlayerDTO) GetHistories() []*HistoryDTO

func (*PlayerDTO) GetLastClaim

func (m *PlayerDTO) GetLastClaim() *types.Timestamp

func (*PlayerDTO) GetReferalClaimAmount

func (m *PlayerDTO) GetReferalClaimAmount() float64

func (*PlayerDTO) GetReferalCount

func (m *PlayerDTO) GetReferalCount() uint64

func (*PlayerDTO) GetReferalID

func (m *PlayerDTO) GetReferalID() uint64

func (*PlayerDTO) GetType

func (m *PlayerDTO) GetType() Payment.CryptoType

func (*PlayerDTO) Marshal

func (m *PlayerDTO) Marshal() (dAtA []byte, err error)

func (*PlayerDTO) MarshalTo

func (m *PlayerDTO) MarshalTo(dAtA []byte) (int, error)

func (*PlayerDTO) MarshalToSizedBuffer

func (m *PlayerDTO) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PlayerDTO) ProtoMessage

func (*PlayerDTO) ProtoMessage()

func (*PlayerDTO) Reset

func (m *PlayerDTO) Reset()

func (*PlayerDTO) Size

func (m *PlayerDTO) Size() (n int)

func (*PlayerDTO) String

func (m *PlayerDTO) String() string

func (*PlayerDTO) Unmarshal

func (m *PlayerDTO) Unmarshal(dAtA []byte) error

func (*PlayerDTO) Validate

func (this *PlayerDTO) Validate() error

func (*PlayerDTO) XXX_DiscardUnknown

func (m *PlayerDTO) XXX_DiscardUnknown()

func (*PlayerDTO) XXX_Marshal

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

func (*PlayerDTO) XXX_Merge

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

func (*PlayerDTO) XXX_MessageName

func (*PlayerDTO) XXX_MessageName() string

func (*PlayerDTO) XXX_Size

func (m *PlayerDTO) XXX_Size() int

func (*PlayerDTO) XXX_Unmarshal

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

type UnimplementedFaucetServiceServer

type UnimplementedFaucetServiceServer struct {
}

UnimplementedFaucetServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedFaucetServiceServer) Claim

func (*UnimplementedFaucetServiceServer) GetPlayer

Jump to

Keyboard shortcuts

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