api

package
v0.0.0-...-489d2f4 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColorPink      ui.Color = 13
	ColorLightBlue ui.Color = 12
	ColorWhite     ui.Color = 15
	ColorBlack     ui.Color = 0
)

Variables

This section is empty.

Functions

func CheckAssignments

func CheckAssignments(args []string)

func CheckSubscription

func CheckSubscription() bool

func GetLatestReset

func GetLatestReset() time.Time

func GetLevelPercentage

func GetLevelPercentage() (int, int)

func GetUserLevel

func GetUserLevel() int

func GetWaniKaniData

func GetWaniKaniData(resource string) []byte

first argument should be 'resource'. Second arg should be 'optional_arg' have to use a variadic argument to support the optional second argument

func InitialConfig

func InitialConfig()

func LoadConfig

func LoadConfig()

func LoadLevelSubject

func LoadLevelSubject(level int) *[]SubjectData

func SetConfig

func SetConfig(key, value string)

func ThrowError

func ThrowError(message string, err error)

func UpdateResetCache

func UpdateResetCache()

func UpdateSubjectsCache

func UpdateSubjectsCache()

Types

type Assignment

type Assignment struct {
	Id   int    `json:"id"`
	URL  string `json:"url"`
	Data struct {
		SubjectID     int    `json:"subject_id"`
		SubjectType   string `json:"subject_type"`
		SRSStage      int    `json:"srs_stage"`
		SRSStageName  string `json:"srs_stage_name"`
		UnlockedAt    string `json:"unlocked_at"`
		StartedAt     string `json:"started_at"`
		PassedAt      string `json:"passed_at"`
		BurnedAt      string `json:"burned_at"`
		AvailableAt   string `json:"available_at"`
		ResurrectedAt string `json:"resurrected_at"`
		Passed        bool   `json:"passed"`
		Resurrected   bool   `json:"resurrected"`
		Hidden        bool   `json:"hidden"`
	} `json:"data"`
}

type AssignmentCollection

type AssignmentCollection struct {
	Pages struct {
		PerPage int    `json:"per_page"`
		NextURL string `json:"next_url"`
	} `json:"pages"`

	TotalCount  int          `json:"total_count"`
	Assignments []Assignment `json:"data"`
}

type AuxiliaryMeanings

type AuxiliaryMeanings struct {
	Meaning string `json:"meaning"`
	Type    string `json:"type"`
}

type CharacterImage

type CharacterImage struct {
	URL         string `json:"url"`
	ContentType string `json:"content_type"`
	Metadata    struct {
		InlineStyles string `json:"inline_styles"`
	} `json:"metadata"`
}

type ContextSentences

type ContextSentences struct {
	English  string `json:"en"`
	Japanese string `json:"ja"`
}

type Meanings

type Meanings struct {
	Meaning        string `json:"meaning"`
	Primary        bool   `json:"primary"`
	AcceptedAnswer bool   `json:"accepted_answer"`
}

type Readings

type Readings struct {
	Type           string `json:"type"`
	Primary        bool   `json:"primary"`
	AcceptedAnswer string `json:"accepted_answer"`
	Reading        string `json:"reading"`
}

type ResetData

type ResetData struct {
	Resets []ResetObj `json:"data"`
}

type ResetObj

type ResetObj struct {
	ResetDetails struct {
		Created       string `json:"created_at"`
		OriginalLevel int    `json:"original_level"`
		TargetLevel   int    `json:"target_level"`
		Confirmed     string `json:"confirmed_at"`
	} `json:"data"`
}

type ReviewCollection

type ReviewCollection struct {
	Url        string       `json:"url"`
	TotalCount string       `json:"total_count"`
	Reviews    []ReviewData `json:"data"`
	Pages      struct {
		NextURL string `json:"next_url"`
	} `json:"pages"`
}

type ReviewData

type ReviewData struct {
	Id     int    `json:"id"`
	Object string `json:"object"`
	Data   struct {
		SubjectId            int    `json:"subject_id"`
		SubjectType          string `json:"subject_type"`
		MeaningCorrect       int    `json:"meaning_correct"`
		MeaningIncorrect     int    `json:"meaning_incorrect"`
		MeaningMaxStreak     int    `json:"meaning_max_streak"`
		MeaningCurrentStreak int    `json:"meaning_current_streak"`
		ReadingCorrect       int    `json:"reading_correct"`
		ReadingIncorrect     int    `json:"reading_incorrect"`
		ReadingMaxStreak     int    `json:"reading_max_streak"`
		ReadingCurrentStreak int    `json:"reading_current_streak"`
		PercentageCorrect    int    `json:"percentage_correct"`
		Hidden               bool   `json:"hidden"`
	} `json:"data"`
}

type SubjectCollection

type SubjectCollection struct {
	Url   string `json:"url"`
	Pages struct {
		NextURL string `json:"next_url"`
	} `json:"pages"`

	Subjects []SubjectData `json:"data"`
}

type SubjectData

type SubjectData struct {
	Id     int    `json:"id"`
	Object string `json:"object"`
	Data   struct {
		AmalgamationSubjectIds []int               `json:"amalgamation_subject_ids"`
		AuxiliaryMeanings      []AuxiliaryMeanings `json:"auxiliary_meanings"`
		Characters             string              `json:"characters"`
		CharacterImages        []CharacterImage    `json:"character_images"`
		ContextSentences       []ContextSentences  `json:"context_sentences"`
		DocumentURL            string              `json:"document_url"`
		HiddenAt               string              `json:"hidden_at"`
		LessonPosition         int                 `json:"lesson_position"`
		Level                  int                 `json:"level"`
		Meanings               []Meanings          `json:"meanings"`
		MeaningMnemonic        string              `json:"meaning_mnemonic"`
		MeaningHint            string              `json:"meaning_hint"`
		Readings               []Readings          `json:"readings"`
		ReadingMnemonic        string              `json:"reading_mnemonic"`
		ReadingHint            string              `json:"reading_hint"`
		PartsOfSpeech          []string            `json:"parts_of_speech"`
		Slug                   string              `json:"slug"`
	} `json:"data"`
}

type UserData

type UserData struct {
	Data struct {
		Username                      string `json:"username"`
		Level                         int    `json:"level"`
		MaxLevelGrantedBySubscription int    `json:"max_level_granted_by_subscription"`
		Subscribed                    bool   `json:"subscribed"`
		Subscription                  struct {
			Active          bool   `json:"active"`
			Type            string `json:"type"`
			MaxLevelGranted string `json:"max_level_granted"`
			PeriodEndsAt    string `json:"period_ends_at"`
		} `json:"subscription"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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