auth

package
v4.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package auth is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)

Functions

func ConvertBech32Prefix

func ConvertBech32Prefix(address, prefix string) (string, error)

ConvertBech32Prefix convert bech32 address to specified prefix.

func RegisterGRPCGatewayRoutes

func RegisterGRPCGatewayRoutes(clientConn grpc.ClientConn, mux *runtime.ServeMux)

func RegisterQueryHandler

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

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

func RegisterQueryHandlerClient

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

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

func RegisterQueryHandlerFromEndpoint

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

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

func RegisterQueryHandlerServer

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer 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 RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type ConvertAddressRequest

type ConvertAddressRequest struct {
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	Prefix  string `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty"`
}

func (*ConvertAddressRequest) Descriptor

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

func (*ConvertAddressRequest) GetAddress

func (m *ConvertAddressRequest) GetAddress() string

func (*ConvertAddressRequest) GetPrefix

func (m *ConvertAddressRequest) GetPrefix() string

func (*ConvertAddressRequest) Marshal

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

func (*ConvertAddressRequest) MarshalTo

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

func (*ConvertAddressRequest) MarshalToSizedBuffer

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

func (*ConvertAddressRequest) ProtoMessage

func (*ConvertAddressRequest) ProtoMessage()

func (*ConvertAddressRequest) Reset

func (m *ConvertAddressRequest) Reset()

func (*ConvertAddressRequest) Size

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

func (*ConvertAddressRequest) String

func (m *ConvertAddressRequest) String() string

func (*ConvertAddressRequest) Unmarshal

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

func (*ConvertAddressRequest) XXX_DiscardUnknown

func (m *ConvertAddressRequest) XXX_DiscardUnknown()

func (*ConvertAddressRequest) XXX_Marshal

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

func (*ConvertAddressRequest) XXX_Merge

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

func (*ConvertAddressRequest) XXX_Size

func (m *ConvertAddressRequest) XXX_Size() int

func (*ConvertAddressRequest) XXX_Unmarshal

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

type ConvertAddressResponse

type ConvertAddressResponse struct {
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
}

func (*ConvertAddressResponse) Descriptor

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

func (*ConvertAddressResponse) GetAddress

func (m *ConvertAddressResponse) GetAddress() string

func (*ConvertAddressResponse) Marshal

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

func (*ConvertAddressResponse) MarshalTo

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

func (*ConvertAddressResponse) MarshalToSizedBuffer

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

func (*ConvertAddressResponse) ProtoMessage

func (*ConvertAddressResponse) ProtoMessage()

func (*ConvertAddressResponse) Reset

func (m *ConvertAddressResponse) Reset()

func (*ConvertAddressResponse) Size

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

func (*ConvertAddressResponse) String

func (m *ConvertAddressResponse) String() string

func (*ConvertAddressResponse) Unmarshal

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

func (*ConvertAddressResponse) XXX_DiscardUnknown

func (m *ConvertAddressResponse) XXX_DiscardUnknown()

func (*ConvertAddressResponse) XXX_Marshal

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

func (*ConvertAddressResponse) XXX_Merge

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

func (*ConvertAddressResponse) XXX_Size

func (m *ConvertAddressResponse) XXX_Size() int

func (*ConvertAddressResponse) XXX_Unmarshal

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

type Querier

type Querier struct{}

func (Querier) ConvertAddress

type QueryClient

type QueryClient interface {
	ConvertAddress(ctx context.Context, in *ConvertAddressRequest, opts ...grpc.CallOption) (*ConvertAddressResponse, error)
}

QueryClient is the client API for Query service.

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

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryServer

type QueryServer interface {
	ConvertAddress(context.Context, *ConvertAddressRequest) (*ConvertAddressResponse, error)
}

QueryServer is the server API for Query service.

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) ConvertAddress

Jump to

Keyboard shortcuts

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