Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var File_url_service_proto protoreflect.FileDescriptor
Functions ¶
func RegisterShortenerServer ¶
func RegisterShortenerServer(s *grpc.Server, srv ShortenerServer)
Types ¶
type Code ¶
type Code struct { Code string `protobuf:"bytes,1,opt,name=Code,proto3" json:"Code,omitempty"` // contains filtered or unexported fields }
func (*Code) Descriptor
deprecated
func (*Code) ProtoMessage ¶
func (*Code) ProtoMessage()
func (*Code) ProtoReflect ¶
func (x *Code) ProtoReflect() protoreflect.Message
type ShortenerClient ¶
type ShortenerClient interface { CreateURL(ctx context.Context, in *URL, opts ...grpc.CallOption) (*Code, error) GetURL(ctx context.Context, in *Code, opts ...grpc.CallOption) (*URL, error) GetStats(ctx context.Context, in *Code, opts ...grpc.CallOption) (*Stats, error) }
ShortenerClient is the client API for Shortener service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewShortenerClient ¶
func NewShortenerClient(cc grpc.ClientConnInterface) ShortenerClient
type ShortenerServer ¶
type ShortenerServer interface { CreateURL(context.Context, *URL) (*Code, error) GetURL(context.Context, *Code) (*URL, error) GetStats(context.Context, *Code) (*Stats, error) }
ShortenerServer is the server API for Shortener service.
type Stats ¶
type Stats struct { Stats string `protobuf:"bytes,1,opt,name=Stats,proto3" json:"Stats,omitempty"` // contains filtered or unexported fields }
func (*Stats) Descriptor
deprecated
func (*Stats) ProtoMessage ¶
func (*Stats) ProtoMessage()
func (*Stats) ProtoReflect ¶
func (x *Stats) ProtoReflect() protoreflect.Message
type URL ¶
type URL struct { LongUrl string `protobuf:"bytes,1,opt,name=LongUrl,proto3" json:"LongUrl,omitempty"` TTL int64 `protobuf:"varint,2,opt,name=TTL,proto3" json:"TTL,omitempty"` Stats string `protobuf:"bytes,3,opt,name=Stats,proto3" json:"Stats,omitempty"` // contains filtered or unexported fields }
func (*URL) Descriptor
deprecated
func (*URL) GetLongUrl ¶
func (*URL) ProtoMessage ¶
func (*URL) ProtoMessage()
func (*URL) ProtoReflect ¶
func (x *URL) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.