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: 7 Imported by: 0

Documentation

Index

Constants

View Source
const GetContextsEndpoint = "contexts/"

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 Context

type Context struct {
	Identifier uint              `json:"pk"          example:"5857878"`
	URL        string            `json:"url"         example:"https://www.lingq.com/api/v2/contexts/{context_identifier}/"`
	Language   language.Language `json:"language"`
	Intense    string            `json:"intense"     example:"insane"`
	StreakDays uint              `json:"streak_days" example:"20"`
	AppleLevel int               `json:"apple_level" example:"5"`
}

type ContextRes

type ContextRes struct {
	Count   uint     `json:"count"`
	Results Contexts `json:"results"`
}

type Contexts

type Contexts []Context

type ContextsQuery

type ContextsQuery struct {
	rest.GetDummyRequester
	Identifier uint
	StreakDays uint
	Language   language.LanguagesQuery
	Intense    string // Casual, Steady, Intense, Insane
}

func (ContextsQuery) Filter

func (cq ContextsQuery) Filter() utils.Predicate[Context]

type GetContextsRepoAction

type GetContextsRepoAction interface {
	GetContexts(context.Context, ContextsQuery) (ContextRes, error)
}

type GetContextsService

type GetContextsService interface {
	GetContexts(context.Context, ContextsQuery) (Contexts, error)
}

type Repo

type Repo interface {
	GetContextsRepoAction
}

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