joke

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_joke_proto protoreflect.FileDescriptor

Functions

func NewJokeEndpoints

func NewJokeEndpoints() []*api.Endpoint

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) Descriptor() ([]byte, []int)

Deprecated: Use JokeInfo.ProtoReflect.Descriptor instead.

func (*JokeInfo) GetBody

func (x *JokeInfo) GetBody() string

func (*JokeInfo) GetCategory

func (x *JokeInfo) GetCategory() string

func (*JokeInfo) GetId

func (x *JokeInfo) GetId() string

func (*JokeInfo) GetSource

func (x *JokeInfo) GetSource() string

func (*JokeInfo) GetTitle

func (x *JokeInfo) GetTitle() string

func (*JokeInfo) ProtoMessage

func (*JokeInfo) ProtoMessage()

func (*JokeInfo) ProtoReflect

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

func (*JokeInfo) Reset

func (x *JokeInfo) Reset()

func (*JokeInfo) String

func (x *JokeInfo) String() string

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

Jump to

Keyboard shortcuts

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