wordle

package
v0.0.0-...-2af310e Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_wordle_proto protoreflect.FileDescriptor

Functions

func NewWordleEndpoints

func NewWordleEndpoints() []*api.Endpoint

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

Deprecated: Use Char.ProtoReflect.Descriptor instead.

func (*Char) GetCorrect

func (x *Char) GetCorrect() bool

func (*Char) GetInWord

func (x *Char) GetInWord() bool

func (*Char) GetLetter

func (x *Char) GetLetter() string

func (*Char) GetPosition

func (x *Char) GetPosition() int32

func (*Char) ProtoMessage

func (*Char) ProtoMessage()

func (*Char) ProtoReflect

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

func (*Char) Reset

func (x *Char) Reset()

func (*Char) String

func (x *Char) String() string

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

Deprecated: Use Guess.ProtoReflect.Descriptor instead.

func (*Guess) GetChars

func (x *Guess) GetChars() []*Char

func (*Guess) GetHighlight

func (x *Guess) GetHighlight() string

func (*Guess) GetWord

func (x *Guess) GetWord() string

func (*Guess) ProtoMessage

func (*Guess) ProtoMessage()

func (*Guess) ProtoReflect

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

func (*Guess) Reset

func (x *Guess) Reset()

func (*Guess) String

func (x *Guess) String() string

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

Jump to

Keyboard shortcuts

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