Documentation ¶
Index ¶
- Variables
- func RegisterTwooterServer(s grpc.ServiceRegistrar, srv TwooterServer)
- type CreateTwootRequest
- func (*CreateTwootRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateTwootRequest) GetTwoot() *Twoot
- func (*CreateTwootRequest) ProtoMessage()
- func (x *CreateTwootRequest) ProtoReflect() protoreflect.Message
- func (x *CreateTwootRequest) Reset()
- func (x *CreateTwootRequest) String() string
- type ListTwootsRequest
- type ListTwootsResponse
- func (*ListTwootsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListTwootsResponse) GetTwoots() []*Twoot
- func (*ListTwootsResponse) ProtoMessage()
- func (x *ListTwootsResponse) ProtoReflect() protoreflect.Message
- func (x *ListTwootsResponse) Reset()
- func (x *ListTwootsResponse) String() string
- type Twoot
- func (*Twoot) Descriptor() ([]byte, []int)deprecated
- func (x *Twoot) GetCreateTime() *timestamppb.Timestamp
- func (x *Twoot) GetCreator() *User
- func (x *Twoot) GetId() string
- func (x *Twoot) GetMessage() string
- func (*Twoot) ProtoMessage()
- func (x *Twoot) ProtoReflect() protoreflect.Message
- func (x *Twoot) Reset()
- func (x *Twoot) String() string
- type TwooterClient
- type TwooterServer
- type UnimplementedTwooterServer
- type UnsafeTwooterServer
- type User
Constants ¶
This section is empty.
Variables ¶
var File_resource_proto protoreflect.FileDescriptor
var File_service_proto protoreflect.FileDescriptor
var Twooter_ServiceDesc = grpc.ServiceDesc{ ServiceName: "twooter.Twooter", HandlerType: (*TwooterServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateTwoot", Handler: _Twooter_CreateTwoot_Handler, }, { MethodName: "ListTwoots", Handler: _Twooter_ListTwoots_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "service.proto", }
Twooter_ServiceDesc is the grpc.ServiceDesc for Twooter service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterTwooterServer ¶
func RegisterTwooterServer(s grpc.ServiceRegistrar, srv TwooterServer)
Types ¶
type CreateTwootRequest ¶
type CreateTwootRequest struct { // Twoot to create. Twoot *Twoot `protobuf:"bytes,1,opt,name=twoot,proto3" json:"twoot,omitempty"` // contains filtered or unexported fields }
func (*CreateTwootRequest) Descriptor
deprecated
func (*CreateTwootRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateTwootRequest.ProtoReflect.Descriptor instead.
func (*CreateTwootRequest) GetTwoot ¶
func (x *CreateTwootRequest) GetTwoot() *Twoot
func (*CreateTwootRequest) ProtoMessage ¶
func (*CreateTwootRequest) ProtoMessage()
func (*CreateTwootRequest) ProtoReflect ¶
func (x *CreateTwootRequest) ProtoReflect() protoreflect.Message
func (*CreateTwootRequest) Reset ¶
func (x *CreateTwootRequest) Reset()
func (*CreateTwootRequest) String ¶
func (x *CreateTwootRequest) String() string
type ListTwootsRequest ¶
type ListTwootsRequest struct {
// contains filtered or unexported fields
}
func (*ListTwootsRequest) Descriptor
deprecated
func (*ListTwootsRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListTwootsRequest.ProtoReflect.Descriptor instead.
func (*ListTwootsRequest) ProtoMessage ¶
func (*ListTwootsRequest) ProtoMessage()
func (*ListTwootsRequest) ProtoReflect ¶
func (x *ListTwootsRequest) ProtoReflect() protoreflect.Message
func (*ListTwootsRequest) Reset ¶
func (x *ListTwootsRequest) Reset()
func (*ListTwootsRequest) String ¶
func (x *ListTwootsRequest) String() string
type ListTwootsResponse ¶
type ListTwootsResponse struct { // The Twoots. Twoots []*Twoot `protobuf:"bytes,1,rep,name=twoots,proto3" json:"twoots,omitempty"` // contains filtered or unexported fields }
func (*ListTwootsResponse) Descriptor
deprecated
func (*ListTwootsResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListTwootsResponse.ProtoReflect.Descriptor instead.
func (*ListTwootsResponse) GetTwoots ¶
func (x *ListTwootsResponse) GetTwoots() []*Twoot
func (*ListTwootsResponse) ProtoMessage ¶
func (*ListTwootsResponse) ProtoMessage()
func (*ListTwootsResponse) ProtoReflect ¶
func (x *ListTwootsResponse) ProtoReflect() protoreflect.Message
func (*ListTwootsResponse) Reset ¶
func (x *ListTwootsResponse) Reset()
func (*ListTwootsResponse) String ¶
func (x *ListTwootsResponse) String() string
type Twoot ¶
type Twoot struct { // Unique identifier of the Twoot. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Creator of the Twoot. Creator *User `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"` // Time the Twoot was created at. CreateTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` // Message of the Twoot. Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*Twoot) Descriptor
deprecated
func (*Twoot) GetCreateTime ¶
func (x *Twoot) GetCreateTime() *timestamppb.Timestamp
func (*Twoot) GetCreator ¶
func (*Twoot) GetMessage ¶
func (*Twoot) ProtoMessage ¶
func (*Twoot) ProtoMessage()
func (*Twoot) ProtoReflect ¶
func (x *Twoot) ProtoReflect() protoreflect.Message
type TwooterClient ¶
type TwooterClient interface { // Creates a Twoot. CreateTwoot(ctx context.Context, in *CreateTwootRequest, opts ...grpc.CallOption) (*Twoot, error) // List all Twoots. ListTwoots(ctx context.Context, in *ListTwootsRequest, opts ...grpc.CallOption) (*ListTwootsResponse, error) }
TwooterClient is the client API for Twooter 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 NewTwooterClient ¶
func NewTwooterClient(cc grpc.ClientConnInterface) TwooterClient
type TwooterServer ¶
type TwooterServer interface { // Creates a Twoot. CreateTwoot(context.Context, *CreateTwootRequest) (*Twoot, error) // List all Twoots. ListTwoots(context.Context, *ListTwootsRequest) (*ListTwootsResponse, error) // contains filtered or unexported methods }
TwooterServer is the server API for Twooter service. All implementations must embed UnimplementedTwooterServer for forward compatibility
type UnimplementedTwooterServer ¶
type UnimplementedTwooterServer struct { }
UnimplementedTwooterServer must be embedded to have forward compatible implementations.
func (UnimplementedTwooterServer) CreateTwoot ¶
func (UnimplementedTwooterServer) CreateTwoot(context.Context, *CreateTwootRequest) (*Twoot, error)
func (UnimplementedTwooterServer) ListTwoots ¶
func (UnimplementedTwooterServer) ListTwoots(context.Context, *ListTwootsRequest) (*ListTwootsResponse, error)
type UnsafeTwooterServer ¶
type UnsafeTwooterServer interface {
// contains filtered or unexported methods
}
UnsafeTwooterServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TwooterServer will result in compilation errors.
type User ¶
type User struct { // Unique identifier of a User. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Public handle of the User. Handle string `protobuf:"bytes,2,opt,name=handle,proto3" json:"handle,omitempty"` // Email address of the User. Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message