Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterShortenerServer(s grpc.ServiceRegistrar, srv ShortenerServer)
- type ShortenerClient
- type ShortenerServer
- type StringMessage
- func (*StringMessage) Descriptor() ([]byte, []int)
- func (m *StringMessage) GetURL() string
- func (*StringMessage) ProtoMessage()
- func (m *StringMessage) Reset()
- func (m *StringMessage) String() string
- func (m *StringMessage) XXX_DiscardUnknown()
- func (m *StringMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *StringMessage) XXX_Merge(src proto.Message)
- func (m *StringMessage) XXX_Size() int
- func (m *StringMessage) XXX_Unmarshal(b []byte) error
- type UnimplementedShortenerServer
- type UnsafeShortenerServer
Constants ¶
const ( Shortener_Get_FullMethodName = "/shortener.Shortener/Get" Shortener_Create_FullMethodName = "/shortener.Shortener/Create" )
Variables ¶
var Shortener_ServiceDesc = grpc.ServiceDesc{ ServiceName: "shortener.Shortener", HandlerType: (*ShortenerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Get", Handler: _Shortener_Get_Handler, }, { MethodName: "Create", Handler: _Shortener_Create_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "shortener.proto", }
Shortener_ServiceDesc is the grpc.ServiceDesc for Shortener service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterShortenerServer ¶
func RegisterShortenerServer(s grpc.ServiceRegistrar, srv ShortenerServer)
Types ¶
type ShortenerClient ¶
type ShortenerClient interface { Get(ctx context.Context, in *StringMessage, opts ...grpc.CallOption) (*StringMessage, error) Create(ctx context.Context, in *StringMessage, opts ...grpc.CallOption) (*StringMessage, error) }
ShortenerClient is the client API for Shortener 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 NewShortenerClient ¶
func NewShortenerClient(cc grpc.ClientConnInterface) ShortenerClient
type ShortenerServer ¶
type ShortenerServer interface { Get(context.Context, *StringMessage) (*StringMessage, error) Create(context.Context, *StringMessage) (*StringMessage, error) // contains filtered or unexported methods }
ShortenerServer is the server API for Shortener service. All implementations must embed UnimplementedShortenerServer for forward compatibility
type StringMessage ¶
type StringMessage struct { URL string `protobuf:"bytes,1,opt,name=URL,proto3" json:"URL,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*StringMessage) Descriptor ¶
func (*StringMessage) Descriptor() ([]byte, []int)
func (*StringMessage) GetURL ¶
func (m *StringMessage) GetURL() string
func (*StringMessage) ProtoMessage ¶
func (*StringMessage) ProtoMessage()
func (*StringMessage) Reset ¶
func (m *StringMessage) Reset()
func (*StringMessage) String ¶
func (m *StringMessage) String() string
func (*StringMessage) XXX_DiscardUnknown ¶
func (m *StringMessage) XXX_DiscardUnknown()
func (*StringMessage) XXX_Marshal ¶
func (m *StringMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*StringMessage) XXX_Merge ¶
func (m *StringMessage) XXX_Merge(src proto.Message)
func (*StringMessage) XXX_Size ¶
func (m *StringMessage) XXX_Size() int
func (*StringMessage) XXX_Unmarshal ¶
func (m *StringMessage) XXX_Unmarshal(b []byte) error
type UnimplementedShortenerServer ¶
type UnimplementedShortenerServer struct { }
UnimplementedShortenerServer must be embedded to have forward compatible implementations.
func (UnimplementedShortenerServer) Create ¶
func (UnimplementedShortenerServer) Create(context.Context, *StringMessage) (*StringMessage, error)
func (UnimplementedShortenerServer) Get ¶
func (UnimplementedShortenerServer) Get(context.Context, *StringMessage) (*StringMessage, error)
type UnsafeShortenerServer ¶
type UnsafeShortenerServer interface {
// contains filtered or unexported methods
}
UnsafeShortenerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ShortenerServer will result in compilation errors.