Documentation
¶
Index ¶
- Variables
- func NewJokeEndpoints() []*api.Endpoint
- func RegisterJokeHandler(s server.Server, hdlr JokeHandler, opts ...server.HandlerOption) error
- type JokeHandler
- type JokeInfo
- func (*JokeInfo) Descriptor() ([]byte, []int)deprecated
- func (x *JokeInfo) GetBody() string
- func (x *JokeInfo) GetCategory() string
- func (x *JokeInfo) GetId() string
- func (x *JokeInfo) GetSource() string
- func (x *JokeInfo) GetTitle() string
- func (*JokeInfo) ProtoMessage()
- func (x *JokeInfo) ProtoReflect() protoreflect.Message
- func (x *JokeInfo) Reset()
- func (x *JokeInfo) String() string
- type JokeService
- type RandomRequest
- type RandomResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var File_proto_joke_proto protoreflect.FileDescriptor
Functions ¶
func NewJokeEndpoints ¶
func RegisterJokeHandler ¶
func RegisterJokeHandler(s server.Server, hdlr JokeHandler, opts ...server.HandlerOption) error
Types ¶
type JokeHandler ¶
type JokeHandler interface {
// get n random jokes
Random(context.Context, *RandomRequest, *RandomResponse) error
}
type JokeInfo ¶
type JokeInfo struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
Body string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
Category string `protobuf:"bytes,4,opt,name=category,proto3" json:"category,omitempty"`
// the source of joke
Source string `protobuf:"bytes,5,opt,name=source,proto3" json:"source,omitempty"`
// contains filtered or unexported fields
}
func (*JokeInfo) Descriptor
deprecated
func (*JokeInfo) GetCategory ¶
func (*JokeInfo) ProtoMessage ¶
func (*JokeInfo) ProtoMessage()
func (*JokeInfo) ProtoReflect ¶
func (x *JokeInfo) ProtoReflect() protoreflect.Message
type JokeService ¶
type JokeService interface {
// get n random jokes
Random(ctx context.Context, in *RandomRequest, opts ...client.CallOption) (*RandomResponse, error)
}
func NewJokeService ¶
func NewJokeService(name string, c client.Client) JokeService
type RandomRequest ¶
type RandomRequest struct {
// the count of random jokes want, maximum: 10
Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
// contains filtered or unexported fields
}
func (*RandomRequest) Descriptor
deprecated
func (*RandomRequest) Descriptor() ([]byte, []int)
Deprecated: Use RandomRequest.ProtoReflect.Descriptor instead.
func (*RandomRequest) GetCount ¶
func (x *RandomRequest) GetCount() int32
func (*RandomRequest) ProtoMessage ¶
func (*RandomRequest) ProtoMessage()
func (*RandomRequest) ProtoReflect ¶
func (x *RandomRequest) ProtoReflect() protoreflect.Message
func (*RandomRequest) Reset ¶
func (x *RandomRequest) Reset()
func (*RandomRequest) String ¶
func (x *RandomRequest) String() string
type RandomResponse ¶
type RandomResponse struct {
Jokes []*JokeInfo `protobuf:"bytes,1,rep,name=jokes,proto3" json:"jokes,omitempty"`
// contains filtered or unexported fields
}
func (*RandomResponse) Descriptor
deprecated
func (*RandomResponse) Descriptor() ([]byte, []int)
Deprecated: Use RandomResponse.ProtoReflect.Descriptor instead.
func (*RandomResponse) GetJokes ¶
func (x *RandomResponse) GetJokes() []*JokeInfo
func (*RandomResponse) ProtoMessage ¶
func (*RandomResponse) ProtoMessage()
func (*RandomResponse) ProtoReflect ¶
func (x *RandomResponse) ProtoReflect() protoreflect.Message
func (*RandomResponse) Reset ¶
func (x *RandomResponse) Reset()
func (*RandomResponse) String ¶
func (x *RandomResponse) String() string
Click to show internal directories.
Click to hide internal directories.