language

package
v0.0.0-...-ff01a36 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const GetLanguagesEndpoint = "languages/"

Variables

This section is empty.

Functions

func Execute

func Execute[T interface{ ToCommand() any }](
	ctx context.Context,
	svc Service,
	cmd T,
) (any, error)

Types

type GetLanguagesRepoAction

type GetLanguagesRepoAction interface {
	GetLanguages(context.Context, LanguagesQuery) (Languages, error)
}

type GetLanguagesService

type GetLanguagesService interface {
	GetLanguages(context.Context, LanguagesQuery) (Languages, error)
}

type Language

type Language struct {
	ID         uint   `json:"id"         example:"53"`
	URL        string `json:"url"        example:"https://www.lingq.com/api/v2/languages/{language_id}/"`
	Code       string `json:"code"       example:"mk"`
	Title      string `json:"title"      example:"Macedonian"`
	Supported  bool   `json:"supported"  example:"false"`
	KnownWords uint   `json:"knownWords" example:"0"`
}

type Languages

type Languages []Language

type LanguagesQuery

type LanguagesQuery struct {
	rest.GetDummyRequester
	Code, Title string
	Supported   *bool
	ID          uint
	KnownWords  uint
}

func (LanguagesQuery) Filter

func (lq LanguagesQuery) Filter() utils.Predicate[Language]

type Repo

type Repo interface {
	GetLanguagesRepoAction
}

func NewRepo

func NewRepo(cl *resty.Client) Repo

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(r Repo) Service

Jump to

Keyboard shortcuts

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