models

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConversionEntry

type ConversionEntry struct {
	Query string `json:"query"`
	Count int64  `json:"count"`
	Guess bool   `json:"guess,omitempty"`

	Words  []*models.Word `json:"-"`
	Result []string       `json:"result"`
}

type ConversionRequest

type ConversionRequest struct {
	Query     string    `json:"query"`
	QueryType QueryType `json:"-"`
}

func (*ConversionRequest) Bind

func (c *ConversionRequest) Bind(r *http.Request) error

type ConversionResponse

type ConversionResponse struct {
	*ConversionRequest
	Count  int                `json:"count"`
	Result []*ConversionEntry `json:"result"`
}

func (*ConversionResponse) Render

func (response *ConversionResponse) Render(w http.ResponseWriter, r *http.Request) (err error)

type QueryType

type QueryType int
const (
	Word   QueryType = iota // word
	Number                  // number
)

func (QueryType) DistinctColumn

func (i QueryType) DistinctColumn() string

func (QueryType) String

func (i QueryType) String() string

func (QueryType) WhereColumn

func (i QueryType) WhereColumn() string

Jump to

Keyboard shortcuts

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