api_tinyurl

package
v0.0.0-...-a33e2ab Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package api_tinyurl is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_tinyurl_proto protoreflect.FileDescriptor

Functions

func RegisterTinyURLHandler

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

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

func RegisterTinyURLHandlerClient

func RegisterTinyURLHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TinyURLClient) error

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

func RegisterTinyURLHandlerFromEndpoint

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

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

func RegisterTinyURLHandlerServer

func RegisterTinyURLHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TinyURLServer) error

RegisterTinyURLHandlerServer registers the http handlers for service TinyURL to "mux". UnaryRPC :call TinyURLServer 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 RegisterTinyURLHandlerFromEndpoint instead.

func RegisterTinyURLServer

func RegisterTinyURLServer(s *grpc.Server, srv TinyURLServer)

Types

type TinyURLClient

type TinyURLClient interface {
	TinyURLEncode(ctx context.Context, in *TinyURLEncodeReq, opts ...grpc.CallOption) (*TinyURLEncodeResp, error)
	TinyURLDecode(ctx context.Context, in *TinyURLDecodeReq, opts ...grpc.CallOption) (*TinyURLDecodeResp, error)
}

TinyURLClient is the client API for TinyURL service.

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

func NewTinyURLClient

func NewTinyURLClient(cc grpc.ClientConnInterface) TinyURLClient

type TinyURLDecodeReq

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

func (*TinyURLDecodeReq) Descriptor deprecated

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

Deprecated: Use TinyURLDecodeReq.ProtoReflect.Descriptor instead.

func (*TinyURLDecodeReq) GetTurl

func (x *TinyURLDecodeReq) GetTurl() string

func (*TinyURLDecodeReq) ProtoMessage

func (*TinyURLDecodeReq) ProtoMessage()

func (*TinyURLDecodeReq) ProtoReflect

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

func (*TinyURLDecodeReq) Reset

func (x *TinyURLDecodeReq) Reset()

func (*TinyURLDecodeReq) String

func (x *TinyURLDecodeReq) String() string

type TinyURLDecodeResObj

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

TinyURLDecode

func (*TinyURLDecodeResObj) Descriptor deprecated

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

Deprecated: Use TinyURLDecodeResObj.ProtoReflect.Descriptor instead.

func (*TinyURLDecodeResObj) GetUrl

func (x *TinyURLDecodeResObj) GetUrl() string

func (*TinyURLDecodeResObj) ProtoMessage

func (*TinyURLDecodeResObj) ProtoMessage()

func (*TinyURLDecodeResObj) ProtoReflect

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

func (*TinyURLDecodeResObj) Reset

func (x *TinyURLDecodeResObj) Reset()

func (*TinyURLDecodeResObj) String

func (x *TinyURLDecodeResObj) String() string

type TinyURLDecodeResp

type TinyURLDecodeResp struct {
	Code int64                `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Msg  string               `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	Data *TinyURLDecodeResObj `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*TinyURLDecodeResp) Descriptor deprecated

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

Deprecated: Use TinyURLDecodeResp.ProtoReflect.Descriptor instead.

func (*TinyURLDecodeResp) GetCode

func (x *TinyURLDecodeResp) GetCode() int64

func (*TinyURLDecodeResp) GetData

func (x *TinyURLDecodeResp) GetData() *TinyURLDecodeResObj

func (*TinyURLDecodeResp) GetMsg

func (x *TinyURLDecodeResp) GetMsg() string

func (*TinyURLDecodeResp) ProtoMessage

func (*TinyURLDecodeResp) ProtoMessage()

func (*TinyURLDecodeResp) ProtoReflect

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

func (*TinyURLDecodeResp) Reset

func (x *TinyURLDecodeResp) Reset()

func (*TinyURLDecodeResp) String

func (x *TinyURLDecodeResp) String() string

type TinyURLEncodeReq

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

func (*TinyURLEncodeReq) Descriptor deprecated

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

Deprecated: Use TinyURLEncodeReq.ProtoReflect.Descriptor instead.

func (*TinyURLEncodeReq) GetUrl

func (x *TinyURLEncodeReq) GetUrl() string

func (*TinyURLEncodeReq) ProtoMessage

func (*TinyURLEncodeReq) ProtoMessage()

func (*TinyURLEncodeReq) ProtoReflect

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

func (*TinyURLEncodeReq) Reset

func (x *TinyURLEncodeReq) Reset()

func (*TinyURLEncodeReq) String

func (x *TinyURLEncodeReq) String() string

type TinyURLEncodeResObj

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

TinyURLEncode

func (*TinyURLEncodeResObj) Descriptor deprecated

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

Deprecated: Use TinyURLEncodeResObj.ProtoReflect.Descriptor instead.

func (*TinyURLEncodeResObj) GetTurl

func (x *TinyURLEncodeResObj) GetTurl() string

func (*TinyURLEncodeResObj) ProtoMessage

func (*TinyURLEncodeResObj) ProtoMessage()

func (*TinyURLEncodeResObj) ProtoReflect

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

func (*TinyURLEncodeResObj) Reset

func (x *TinyURLEncodeResObj) Reset()

func (*TinyURLEncodeResObj) String

func (x *TinyURLEncodeResObj) String() string

type TinyURLEncodeResp

type TinyURLEncodeResp struct {
	Code int64                `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Msg  string               `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	Data *TinyURLEncodeResObj `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*TinyURLEncodeResp) Descriptor deprecated

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

Deprecated: Use TinyURLEncodeResp.ProtoReflect.Descriptor instead.

func (*TinyURLEncodeResp) GetCode

func (x *TinyURLEncodeResp) GetCode() int64

func (*TinyURLEncodeResp) GetData

func (x *TinyURLEncodeResp) GetData() *TinyURLEncodeResObj

func (*TinyURLEncodeResp) GetMsg

func (x *TinyURLEncodeResp) GetMsg() string

func (*TinyURLEncodeResp) ProtoMessage

func (*TinyURLEncodeResp) ProtoMessage()

func (*TinyURLEncodeResp) ProtoReflect

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

func (*TinyURLEncodeResp) Reset

func (x *TinyURLEncodeResp) Reset()

func (*TinyURLEncodeResp) String

func (x *TinyURLEncodeResp) String() string

type TinyURLServer

type TinyURLServer interface {
	TinyURLEncode(context.Context, *TinyURLEncodeReq) (*TinyURLEncodeResp, error)
	TinyURLDecode(context.Context, *TinyURLDecodeReq) (*TinyURLDecodeResp, error)
}

TinyURLServer is the server API for TinyURL service.

type UnimplementedTinyURLServer

type UnimplementedTinyURLServer struct {
}

UnimplementedTinyURLServer can be embedded to have forward compatible implementations.

func (*UnimplementedTinyURLServer) TinyURLDecode

func (*UnimplementedTinyURLServer) TinyURLEncode

Jump to

Keyboard shortcuts

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