Documentation
¶
Index ¶
- Variables
- func NewWordleEndpoints() []*api.Endpoint
- func RegisterWordleHandler(s server.Server, hdlr WordleHandler, opts ...server.HandlerOption) error
- type Char
- func (*Char) Descriptor() ([]byte, []int)deprecated
- func (x *Char) GetCorrect() bool
- func (x *Char) GetInWord() bool
- func (x *Char) GetLetter() string
- func (x *Char) GetPosition() int32
- func (*Char) ProtoMessage()
- func (x *Char) ProtoReflect() protoreflect.Message
- func (x *Char) Reset()
- func (x *Char) String() string
- type Guess
- type GuessRequest
- func (*GuessRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GuessRequest) GetPlayer() string
- func (x *GuessRequest) GetWord() string
- func (*GuessRequest) ProtoMessage()
- func (x *GuessRequest) ProtoReflect() protoreflect.Message
- func (x *GuessRequest) Reset()
- func (x *GuessRequest) String() string
- type GuessResponse
- func (*GuessResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GuessResponse) GetAnswer() string
- func (x *GuessResponse) GetCorrect() bool
- func (x *GuessResponse) GetGuesses() []*Guess
- func (x *GuessResponse) GetStatus() string
- func (x *GuessResponse) GetTriesLeft() int32
- func (*GuessResponse) ProtoMessage()
- func (x *GuessResponse) ProtoReflect() protoreflect.Message
- func (x *GuessResponse) Reset()
- func (x *GuessResponse) String() string
- type NextRequest
- type NextResponse
- func (*NextResponse) Descriptor() ([]byte, []int)deprecated
- func (x *NextResponse) GetDuration() string
- func (x *NextResponse) GetSeconds() int32
- func (*NextResponse) ProtoMessage()
- func (x *NextResponse) ProtoReflect() protoreflect.Message
- func (x *NextResponse) Reset()
- func (x *NextResponse) String() string
- type WordleHandler
- type WordleService
Constants ¶
This section is empty.
Variables ¶
View Source
var File_proto_wordle_proto protoreflect.FileDescriptor
Functions ¶
func NewWordleEndpoints ¶
func RegisterWordleHandler ¶
func RegisterWordleHandler(s server.Server, hdlr WordleHandler, opts ...server.HandlerOption) error
Types ¶
type Char ¶
type Char struct {
// the character itself
Letter string `protobuf:"bytes,1,opt,name=letter,proto3" json:"letter,omitempty"`
// position in the string
Position int32 `protobuf:"varint,2,opt,name=position,proto3" json:"position,omitempty"`
// whether it was correct
Correct bool `protobuf:"varint,3,opt,name=correct,proto3" json:"correct,omitempty"`
// whether it's in the word
InWord bool `protobuf:"varint,4,opt,name=in_word,json=inWord,proto3" json:"in_word,omitempty"`
// contains filtered or unexported fields
}
func (*Char) Descriptor
deprecated
func (*Char) GetCorrect ¶
func (*Char) GetPosition ¶
func (*Char) ProtoMessage ¶
func (*Char) ProtoMessage()
func (*Char) ProtoReflect ¶
func (x *Char) ProtoReflect() protoreflect.Message
type Guess ¶
type Guess struct {
// the full guess word
Word string `protobuf:"bytes,1,opt,name=word,proto3" json:"word,omitempty"`
// the highlighted word e.g n[o]is{e}
// where [ ] is correct, { } is in word
Highlight string `protobuf:"bytes,2,opt,name=highlight,proto3" json:"highlight,omitempty"`
// individual characters
Chars []*Char `protobuf:"bytes,3,rep,name=chars,proto3" json:"chars,omitempty"`
// contains filtered or unexported fields
}
func (*Guess) Descriptor
deprecated
func (*Guess) GetHighlight ¶
func (*Guess) ProtoMessage ¶
func (*Guess) ProtoMessage()
func (*Guess) ProtoReflect ¶
func (x *Guess) ProtoReflect() protoreflect.Message
type GuessRequest ¶
type GuessRequest struct {
// player
Player string `protobuf:"bytes,1,opt,name=player,proto3" json:"player,omitempty"`
// guess word
Word string `protobuf:"bytes,2,opt,name=word,proto3" json:"word,omitempty"`
// contains filtered or unexported fields
}
Make a guess
func (*GuessRequest) Descriptor
deprecated
func (*GuessRequest) Descriptor() ([]byte, []int)
Deprecated: Use GuessRequest.ProtoReflect.Descriptor instead.
func (*GuessRequest) GetPlayer ¶
func (x *GuessRequest) GetPlayer() string
func (*GuessRequest) GetWord ¶
func (x *GuessRequest) GetWord() string
func (*GuessRequest) ProtoMessage ¶
func (*GuessRequest) ProtoMessage()
func (*GuessRequest) ProtoReflect ¶
func (x *GuessRequest) ProtoReflect() protoreflect.Message
func (*GuessRequest) Reset ¶
func (x *GuessRequest) Reset()
func (*GuessRequest) String ¶
func (x *GuessRequest) String() string
type GuessResponse ¶
type GuessResponse struct {
// whether it was correct
Correct bool `protobuf:"varint,1,opt,name=correct,proto3" json:"correct,omitempty"`
// number of tries left
TriesLeft int32 `protobuf:"varint,2,opt,name=tries_left,json=triesLeft,proto3" json:"tries_left,omitempty"`
// the guess words tried
Guesses []*Guess `protobuf:"bytes,3,rep,name=guesses,proto3" json:"guesses,omitempty"`
// the actual word if failed
Answer string `protobuf:"bytes,4,opt,name=answer,proto3" json:"answer,omitempty"`
// informational message
Status string `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"`
// contains filtered or unexported fields
}
func (*GuessResponse) Descriptor
deprecated
func (*GuessResponse) Descriptor() ([]byte, []int)
Deprecated: Use GuessResponse.ProtoReflect.Descriptor instead.
func (*GuessResponse) GetAnswer ¶
func (x *GuessResponse) GetAnswer() string
func (*GuessResponse) GetCorrect ¶
func (x *GuessResponse) GetCorrect() bool
func (*GuessResponse) GetGuesses ¶
func (x *GuessResponse) GetGuesses() []*Guess
func (*GuessResponse) GetStatus ¶
func (x *GuessResponse) GetStatus() string
func (*GuessResponse) GetTriesLeft ¶
func (x *GuessResponse) GetTriesLeft() int32
func (*GuessResponse) ProtoMessage ¶
func (*GuessResponse) ProtoMessage()
func (*GuessResponse) ProtoReflect ¶
func (x *GuessResponse) ProtoReflect() protoreflect.Message
func (*GuessResponse) Reset ¶
func (x *GuessResponse) Reset()
func (*GuessResponse) String ¶
func (x *GuessResponse) String() string
type NextRequest ¶
type NextRequest struct {
// contains filtered or unexported fields
}
When does the next game start
func (*NextRequest) Descriptor
deprecated
func (*NextRequest) Descriptor() ([]byte, []int)
Deprecated: Use NextRequest.ProtoReflect.Descriptor instead.
func (*NextRequest) ProtoMessage ¶
func (*NextRequest) ProtoMessage()
func (*NextRequest) ProtoReflect ¶
func (x *NextRequest) ProtoReflect() protoreflect.Message
func (*NextRequest) Reset ¶
func (x *NextRequest) Reset()
func (*NextRequest) String ¶
func (x *NextRequest) String() string
type NextResponse ¶
type NextResponse struct {
// number of seconds
Seconds int32 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"`
// in hh:mm:ss
Duration string `protobuf:"bytes,2,opt,name=duration,proto3" json:"duration,omitempty"`
// contains filtered or unexported fields
}
func (*NextResponse) Descriptor
deprecated
func (*NextResponse) Descriptor() ([]byte, []int)
Deprecated: Use NextResponse.ProtoReflect.Descriptor instead.
func (*NextResponse) GetDuration ¶
func (x *NextResponse) GetDuration() string
func (*NextResponse) GetSeconds ¶
func (x *NextResponse) GetSeconds() int32
func (*NextResponse) ProtoMessage ¶
func (*NextResponse) ProtoMessage()
func (*NextResponse) ProtoReflect ¶
func (x *NextResponse) ProtoReflect() protoreflect.Message
func (*NextResponse) Reset ¶
func (x *NextResponse) Reset()
func (*NextResponse) String ¶
func (x *NextResponse) String() string
type WordleHandler ¶
type WordleHandler interface {
Guess(context.Context, *GuessRequest, *GuessResponse) error
Next(context.Context, *NextRequest, *NextResponse) error
}
type WordleService ¶
type WordleService interface {
Guess(ctx context.Context, in *GuessRequest, opts ...client.CallOption) (*GuessResponse, error)
Next(ctx context.Context, in *NextRequest, opts ...client.CallOption) (*NextResponse, error)
}
func NewWordleService ¶
func NewWordleService(name string, c client.Client) WordleService
Click to show internal directories.
Click to hide internal directories.