trxv1

package
v0.0.0-...-7230577 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package trxv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_common_proto protoreflect.FileDescriptor
View Source
var TrxService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "trxv1.TrxService",
	HandlerType: (*TrxServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetTrxBalance",
			Handler:    _TrxService_GetTrxBalance_Handler,
		},
		{
			MethodName: "GetTRC20TokenBalance",
			Handler:    _TrxService_GetTRC20TokenBalance_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "trx.proto",
}

TrxService_ServiceDesc is the grpc.ServiceDesc for TrxService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterTrxServiceHandler

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

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

func RegisterTrxServiceHandlerClient

func RegisterTrxServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TrxServiceClient) error

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

func RegisterTrxServiceHandlerFromEndpoint

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

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

func RegisterTrxServiceHandlerServer

func RegisterTrxServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TrxServiceServer) error

RegisterTrxServiceHandlerServer registers the http handlers for service TrxService to "mux". UnaryRPC :call TrxServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterTrxServiceServer

func RegisterTrxServiceServer(s grpc.ServiceRegistrar, srv TrxServiceServer)

Types

type Error

type Error struct {
	Code    int32      `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Message string     `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	Detail  *anypb.Any `protobuf:"bytes,3,opt,name=detail,proto3" json:"detail,omitempty"`
	// contains filtered or unexported fields
}

func (*Error) Descriptor deprecated

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

Deprecated: Use Error.ProtoReflect.Descriptor instead.

func (*Error) GetCode

func (x *Error) GetCode() int32

func (*Error) GetDetail

func (x *Error) GetDetail() *anypb.Any

func (*Error) GetMessage

func (x *Error) GetMessage() string

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) ProtoReflect

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

func (*Error) Reset

func (x *Error) Reset()

func (*Error) String

func (x *Error) String() string

type GetTRC20TokenBalanceReply

type GetTRC20TokenBalanceReply struct {
	Token   string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	Balance string `protobuf:"bytes,2,opt,name=balance,proto3" json:"balance,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTRC20TokenBalanceReply) Descriptor deprecated

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

Deprecated: Use GetTRC20TokenBalanceReply.ProtoReflect.Descriptor instead.

func (*GetTRC20TokenBalanceReply) GetBalance

func (x *GetTRC20TokenBalanceReply) GetBalance() string

func (*GetTRC20TokenBalanceReply) GetToken

func (x *GetTRC20TokenBalanceReply) GetToken() string

func (*GetTRC20TokenBalanceReply) ProtoMessage

func (*GetTRC20TokenBalanceReply) ProtoMessage()

func (*GetTRC20TokenBalanceReply) ProtoReflect

func (*GetTRC20TokenBalanceReply) Reset

func (x *GetTRC20TokenBalanceReply) Reset()

func (*GetTRC20TokenBalanceReply) String

func (x *GetTRC20TokenBalanceReply) String() string

type GetTRC20TokenBalanceRequest

type GetTRC20TokenBalanceRequest struct {
	Token   string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
	Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTRC20TokenBalanceRequest) Descriptor deprecated

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

Deprecated: Use GetTRC20TokenBalanceRequest.ProtoReflect.Descriptor instead.

func (*GetTRC20TokenBalanceRequest) GetAddress

func (x *GetTRC20TokenBalanceRequest) GetAddress() string

func (*GetTRC20TokenBalanceRequest) GetToken

func (x *GetTRC20TokenBalanceRequest) GetToken() string

func (*GetTRC20TokenBalanceRequest) ProtoMessage

func (*GetTRC20TokenBalanceRequest) ProtoMessage()

func (*GetTRC20TokenBalanceRequest) ProtoReflect

func (*GetTRC20TokenBalanceRequest) Reset

func (x *GetTRC20TokenBalanceRequest) Reset()

func (*GetTRC20TokenBalanceRequest) String

func (x *GetTRC20TokenBalanceRequest) String() string

type GetTrxBalanceReply

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

func (*GetTrxBalanceReply) Descriptor deprecated

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

Deprecated: Use GetTrxBalanceReply.ProtoReflect.Descriptor instead.

func (*GetTrxBalanceReply) GetBalance

func (x *GetTrxBalanceReply) GetBalance() string

func (*GetTrxBalanceReply) ProtoMessage

func (*GetTrxBalanceReply) ProtoMessage()

func (*GetTrxBalanceReply) ProtoReflect

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

func (*GetTrxBalanceReply) Reset

func (x *GetTrxBalanceReply) Reset()

func (*GetTrxBalanceReply) String

func (x *GetTrxBalanceReply) String() string

type GetTrxBalanceRequest

type GetTrxBalanceRequest struct {
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTrxBalanceRequest) Descriptor deprecated

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

Deprecated: Use GetTrxBalanceRequest.ProtoReflect.Descriptor instead.

func (*GetTrxBalanceRequest) GetAddress

func (x *GetTrxBalanceRequest) GetAddress() string

func (*GetTrxBalanceRequest) ProtoMessage

func (*GetTrxBalanceRequest) ProtoMessage()

func (*GetTrxBalanceRequest) ProtoReflect

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

func (*GetTrxBalanceRequest) Reset

func (x *GetTrxBalanceRequest) Reset()

func (*GetTrxBalanceRequest) String

func (x *GetTrxBalanceRequest) String() string

type Pager

type Pager struct {
	Page      int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
	PageSize  int64 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"`
	TotalRows int64 `protobuf:"varint,3,opt,name=totalRows,proto3" json:"totalRows,omitempty"`
	// contains filtered or unexported fields
}

func (*Pager) Descriptor deprecated

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

Deprecated: Use Pager.ProtoReflect.Descriptor instead.

func (*Pager) GetPage

func (x *Pager) GetPage() int64

func (*Pager) GetPageSize

func (x *Pager) GetPageSize() int64

func (*Pager) GetTotalRows

func (x *Pager) GetTotalRows() int64

func (*Pager) ProtoMessage

func (*Pager) ProtoMessage()

func (*Pager) ProtoReflect

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

func (*Pager) Reset

func (x *Pager) Reset()

func (*Pager) String

func (x *Pager) String() string

type TrxServiceClient

type TrxServiceClient interface {
	GetTrxBalance(ctx context.Context, in *GetTrxBalanceRequest, opts ...grpc.CallOption) (*GetTrxBalanceReply, error)
	GetTRC20TokenBalance(ctx context.Context, in *GetTRC20TokenBalanceRequest, opts ...grpc.CallOption) (*GetTRC20TokenBalanceReply, error)
}

TrxServiceClient is the client API for TrxService 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 NewTrxServiceClient

func NewTrxServiceClient(cc grpc.ClientConnInterface) TrxServiceClient

type TrxServiceServer

type TrxServiceServer interface {
	GetTrxBalance(context.Context, *GetTrxBalanceRequest) (*GetTrxBalanceReply, error)
	GetTRC20TokenBalance(context.Context, *GetTRC20TokenBalanceRequest) (*GetTRC20TokenBalanceReply, error)
	// contains filtered or unexported methods
}

TrxServiceServer is the server API for TrxService service. All implementations must embed UnimplementedTrxServiceServer for forward compatibility

type UnimplementedTrxServiceServer

type UnimplementedTrxServiceServer struct {
}

UnimplementedTrxServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedTrxServiceServer) GetTrxBalance

type UnsafeTrxServiceServer

type UnsafeTrxServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeTrxServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TrxServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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