activity

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

Documentation

Index

Constants

View Source
const (
	LanguageIDPathParam = "languageID"
	GetActivityEndpoint = "/{" + LanguageIDPathParam + "}/study-stats/"
)

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 Activity

type Activity struct {
	ActivityApple  string        `json:"activityApple"`
	Coints         uint          `json:"coins"`
	Language       string        `json:"string"`
	DailyGoal      uint          `json:"dailyGoal"`
	StreakDays     uint          `json:"streakDays"`
	ActivityLevel  ActivityLevel `json:"activityLevel"`
	DailyMetric    string        `json:"dailyMetric"`
	DailyScores    DailyScores   `json:"dailyScores"`
	KnownWords     uint          `json:"knownWords"`
	IsStreakBroken bool          `json:"isStreakBroken"`
}

type ActivityLevel

type ActivityLevel struct {
	Score uint `json:"score"`
	ID    uint `json:"id"`
}

type ActivityQuery

type ActivityQuery struct {
	rest.GetDummyRequester
	Language string
}

func (ActivityQuery) ToPathParameter

func (a ActivityQuery) ToPathParameter() (map[string]string, error)

type DailyScore

type DailyScore struct {
	Date          entities.DateOnly `json:"date"`
	DayOfWeek     string            `json:"dayOfWeek"`
	ActivityLevel ActivityLevel     `json:"activityLevel"`
	Score         uint              `json:"score"`
}

type DailyScores

type DailyScores []DailyScore

type GetActivityRepoAction

type GetActivityRepoAction interface {
	GetActivity(context.Context, ActivityQuery) (Activity, error)
}

type GetActivityService

type GetActivityService interface {
	GetActivity(context.Context, ActivityQuery) (Activity, error)
}

type Lingq

type Lingq struct {
	Date          entities.DateOnly `json:"date"`
	DayOfWeek     string            `json:"dayOfWeek"`
	LingqsCreated uint              `json:"lingqsCreated"`
}

type Lingqs

type Lingqs []Lingq

type Repo

type Repo interface {
	GetActivityRepoAction
}

func NewRepo

func NewRepo(cl *resty.Client) Repo

type Service

type Service struct {
	GetActivityService
}

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