Documentation
¶
Index ¶
- func AssociateParentID(id uint) uint
- func PopulateFromResource(artifact interface{}, resource string) error
- type Article
- func (article *Article) FetchContent(recursive bool) error
- func (rootArticle *Article) FindByID(id uint) *Article
- func (rootArticle *Article) FindByTitle(title string) *Article
- func (rootArticle *Article) FindNext(article *Article) (*Article, error)
- func (rootArticle *Article) FindParent(child *Article) *Article
- func (rootArticle *Article) FindPrevious(article *Article) (*Article, error)
- func (rootArticle *Article) Write(db *gorm.DB) error
- type Artifact
- type DB
- type Exercise
- type ExerciseRoot
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssociateParentID ¶
func PopulateFromResource ¶
Types ¶
type Article ¶
type Article struct { gorm.Model Title string `json:"title"` Remote string `json:"remote"` Content []byte ParentRefer uint Children []Article `json:"children" gorm:"foreignKey:ParentRefer"` }
func PopulateArticles ¶
func (*Article) FetchContent ¶
func (*Article) FindByTitle ¶
func (*Article) FindParent ¶
func (*Article) FindPrevious ¶
type Exercise ¶
type Exercise struct { gorm.Model Content string `json:"content"` ChecksWithScript bool `json:"checks_with_script"` Expects string `json:"expects"` ParentArticleRefer uint ParentArticle Article `gorm:"foreignKey:ParentArticleRefer"` }
func PopulateExercises ¶
type ExerciseRoot ¶
type ExerciseRoot struct { ArticleTitle string `json:"article_title"` Exercises []Exercise `json:"exercises"` }
should be used only when loading from exercise list resource.
Click to show internal directories.
Click to hide internal directories.