Documentation
¶
Index ¶
- Variables
- type Assignment
- type Assignments
- type Client
- func (c *Client) CreateReview(ctx context.Context, payload Reviews, opts ...Option) (*ReviewResponse, error)
- func (c *Client) GetAssignment(ctx context.Context, id int, opts ...Option) (*Resource[Assignment], error)
- func (c *Client) GetAssignments(ctx context.Context, opts ...Option) (*Paginate[Assignment], error)
- func (c *Client) GetSubject(ctx context.Context, id int, opts ...Option) (*Resource[Subject], error)
- func (c *Client) GetSubjects(ctx context.Context, opts ...Option) (*Paginate[Subject], error)
- func (c *Client) GetUser(ctx context.Context, opts ...Option) (*Resource[User], error)
- func (c *Client) StartAssignment(ctx context.Context, payload Assignments, id int, opts ...Option) (*Resource[Assignment], error)
- func (c *Client) UpdateUser(ctx context.Context, payload Users, opts ...Option) (*Resource[User], error)
- type Collection
- type CollectionBase
- type Option
- func WithAvailableAfter(t time.Time) Option
- func WithAvailableBefore(t time.Time) Option
- func WithAvailableLessons(available bool) Option
- func WithAvailableReviews(available bool) Option
- func WithBurned(burned bool) Option
- func WithHidden(hidden bool) Option
- func WithIDs(ids ...int) Option
- func WithLevels(levels []int) Option
- func WithSlugs(slugs []string) Option
- func WithStages(stages ...int) Option
- func WithSubjectIDs(ids []int) Option
- func WithSubjectTypes(types []string) Option
- func WithTypes(types []SubjectType) Option
- func WithUnlocked(unlocked bool) Option
- func WithUpdatedAfter(t time.Time) Option
- type Paginate
- type Preferences
- type Resource
- type ResourceBase
- type Review
- type ReviewBase
- type ReviewResourcesUpdated
- type ReviewResponse
- type Reviews
- type Shared
- type StudyMaterials
- type Subject
- type SubjectType
- type User
- type Users
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Assignment ¶
type Assignment struct {
SubjectType string `json:"subject_type"`
SubjectID int `json:"subject_id"`
Level int `json:"level"`
Stage int `json:"srs_stage"`
UnlockedAt *time.Time `json:"unlocked_at"`
StartedAt *time.Time `json:"started_at"`
PassedAt *time.Time `json:"passed_at"`
BurnedAt *time.Time `json:"burned_at"`
AvailableAt *time.Time `json:"available_at"`
ResurrectedAt *time.Time `json:"resurrected_at"`
}
type Assignments ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClientWithHTTP ¶ added in v0.2.1
func (*Client) CreateReview ¶ added in v0.1.0
func (*Client) GetAssignment ¶
func (*Client) GetAssignments ¶
func (*Client) GetSubject ¶ added in v0.1.0
func (*Client) GetSubjects ¶ added in v0.1.0
func (*Client) StartAssignment ¶
func (c *Client) StartAssignment(ctx context.Context, payload Assignments, id int, opts ...Option) (*Resource[Assignment], error)
type Collection ¶
type Collection[T any] struct { CollectionBase Data []Resource[T] `json:"data"` }
type CollectionBase ¶
type Option ¶
type Option func(*options) error
func WithAvailableAfter ¶
func WithAvailableBefore ¶
func WithAvailableLessons ¶
func WithAvailableReviews ¶
func WithBurned ¶
func WithHidden ¶
func WithStages ¶ added in v0.2.1
func WithSubjectIDs ¶
func WithSubjectTypes ¶
func WithTypes ¶ added in v0.1.0
func WithTypes(types []SubjectType) Option
func WithUnlocked ¶
func WithUpdatedAfter ¶
type Paginate ¶
type Paginate[T any] struct { Data Collection[T] // contains filtered or unexported fields }
func (*Paginate[T]) HasPrevious ¶ added in v0.2.1
type Preferences ¶ added in v0.2.0
type Preferences struct {
DefaultVoiceActorID int `json:"default_voice_actor_id"`
ExtraStudyAutoplayAudio bool `json:"extra_study_autoplay_audio"`
LessonsAutoplayAudio bool `json:"lessons_autoplay_audio"`
LessonsBatchSize int `json:"lessons_batch_size"`
LessonsPresentationOrder string `json:"lessons_presentation_order"`
ReviewsAutoplayAudio bool `json:"reviews_autoplay_audio"`
ReviewsDisplaySrsIndicator bool `json:"reviews_display_srs_indicator"`
ReviewsPresentationOrder string `json:"reviews_presentation_order"`
}
type Resource ¶
type Resource[T any] struct { ResourceBase Data T `json:"data"` }
type ResourceBase ¶
type ResourceBase struct {
ID int `json:"id"`
}
type Review ¶ added in v0.1.0
type Review struct {
ReviewBase
SubjectID int `json:"subject_id"`
StartingSRS int `json:"starting_srs_stage"`
EndingSRS int `json:"ending_srs_stage"`
SRSID int `json:"spaced_repetition_system_id"`
}
type ReviewBase ¶ added in v0.1.0
type ReviewResourcesUpdated ¶ added in v0.3.0
type ReviewResourcesUpdated struct {
Assignment Resource[Assignment] `json:"assignment"`
}
type ReviewResponse ¶ added in v0.3.0
type ReviewResponse struct {
Resource[Review]
ResourcesUpdated ReviewResourcesUpdated `json:"resources_updated"`
}
type Reviews ¶
type Reviews struct {
Review ReviewBase `json:"review"`
}
type StudyMaterials ¶ added in v0.1.0
type Subject ¶ added in v0.1.0
type Subject struct {
AuxiliaryMeanings []struct {
Meaning string `json:"meaning"`
Primary bool `json:"primary"`
AcceptedAnswer bool `json:"accepted_answer"`
}
Characters string `json:"characters"`
CreatedAt time.Time `json:"created_at"`
DocumentURL string `json:"document_url"`
HiddenAt *time.Time `json:"hidden_at"`
Level int `json:"level"`
MeaningMnemonic string `json:"meaning_mnemonic"`
Meanings []struct {
Meaning string `json:"meaning"`
Type string `json:"type"`
}
Slug string `json:"slug"`
SRSID int `json:"spaced_repetition_system_id"`
}
type SubjectType ¶ added in v0.3.0
type SubjectType string
const ( SubjectTypeKanaVocabulary SubjectType = "kana_vocabulary" SubjectTypeKanji SubjectType = "kanji" SubjectTypeRadical SubjectType = "radical" SubjectTypeVocabulary SubjectType = "vocabulary" )
type User ¶
type User struct {
ID string `json:"id"`
Name string `json:"username"`
Level int `json:"level"`
ProfileURL string `json:"profile_url"`
StartedAt time.Time `json:"started_at"`
CurrentVacationStartedAt *time.Time `json:"current_vacation_started_at"`
Subscription struct {
Active bool `json:"active"`
Type string `json:"type"`
MaxLevelGranted int `json:"max_level_granted"`
PeriodEndsAt time.Time `json:"period_ends_at"`
} `json:"subscription"`
Preferences Preferences `json:"preferences"`
}
type Users ¶ added in v0.1.0
type Users struct {
User struct {
Preferences Preferences `json:"preferences"`
} `json:"user"`
}
Click to show internal directories.
Click to hide internal directories.