Documentation
¶
Index ¶
- type Assignment
- type Assignments
- type Client
- func (c *Client) CreateReview(payload Reviews, opts ...Option) (*Resource[Review], error)
- func (c *Client) GetAssignment(id int, opts ...Option) (*Resource[Assignment], error)
- func (c *Client) GetAssignments(opts ...Option) (*Paginate[Assignment], error)
- func (c *Client) GetReview(id int, opts ...Option) (*Resource[Review], error)
- func (c *Client) GetSubject(id int, opts ...Option) (*Resource[Subject], error)
- func (c *Client) GetSubjects(opts ...Option) (*Paginate[Subject], error)
- func (c *Client) StartAssignment(payload Assignments, id int, opts ...Option) (*Resource[Assignment], 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 WithStage(stages []int) Option
- func WithSubjectIDs(ids []int) Option
- func WithSubjectTypes(types []string) Option
- func WithTypes(types []string) Option
- func WithUnlocked(unlocked bool) Option
- func WithUpdatedAfter(t time.Time) Option
- type Paginate
- type Resource
- type ResourceBase
- type Review
- type ReviewBase
- type Reviews
- type Shared
- type StudyMaterials
- type Subject
- type Users
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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 (*Client) CreateReview ¶ added in v0.1.0
func (*Client) GetAssignment ¶
func (*Client) GetAssignments ¶
func (c *Client) GetAssignments(opts ...Option) (*Paginate[Assignment], error)
func (*Client) GetSubject ¶ added in v0.1.0
func (*Client) GetSubjects ¶ added in v0.1.0
func (*Client) StartAssignment ¶
func (c *Client) StartAssignment(payload Assignments, id int, opts ...Option) (*Resource[Assignment], error)
type Collection ¶
type Collection[T any] struct { CollectionBase Data []struct { ResourceBase Data T `json:"data"` } `json:"data"` }
type CollectionBase ¶
type Option ¶
type Option func(*options) error
func WithAvailableAfter ¶
func WithAvailableBefore ¶
func WithAvailableLessons ¶
func WithAvailableReviews ¶
func WithBurned ¶
func WithHidden ¶
func WithLevels ¶
func WithSubjectIDs ¶
func WithSubjectTypes ¶
func WithUnlocked ¶
func WithUpdatedAfter ¶
type Paginate ¶
type Paginate[T any] struct { Data Collection[T] // contains filtered or unexported fields }
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 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 Users ¶ added in v0.1.0
type Users struct {
User struct {
Preferences struct {
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"`
} `json:"preferences"`
} `json:"user"`
}
Click to show internal directories.
Click to hide internal directories.