Documentation ¶
Index ¶
- Constants
- Variables
- func GetFileAt(path string) ([]byte, error)
- func InitTreeFromRepo(repo string)
- func UpdateTreeFromRepo(repo string)
- type Article
- type CacheStorage
- func (cs CacheStorage) Get(user, repo, branch, phase, stage, article, lang string) (Tip, bool)
- func (cs CacheStorage) GetPathFromSlug(user, repo, branch, slug string) (string, bool)
- func (cs CacheStorage) GetSlug(user, repo, branch, slug, lang string) (Tip, bool)
- func (cs CacheStorage) List(from, to int, user, repo, branch, phase, stage, article, lang string) []Tip
- func (cs CacheStorage) Push(tip Tip)
- type Image
- type Link
- type Product
- type Reminder
- type Section
- type Source
- type Tip
- type Trigger
Constants ¶
View Source
const DefaultLang = "en"
DefaultLang -
Variables ¶
View Source
var ( // Cache - Cache = CacheStorage{} )
Functions ¶
func InitTreeFromRepo ¶
func InitTreeFromRepo(repo string)
InitTreeFromRepo init the storage tree from github
func UpdateTreeFromRepo ¶
func UpdateTreeFromRepo(repo string)
UpdateTreeFromRepo update the storage tree from github
Types ¶
type Article ¶
type Article struct { Lang string `json:"lang"` Title string `json:"title"` Name string `json:"name"` Tags []string `yaml:"tags" json:"tags"` Reftime string `yaml:"reftime" json:"refTime"` Intro Section `yaml:"intro" json:"intro"` Sections []Section `yaml:"sections" json:"sections"` Products []Product `yaml:"products" json:"products"` Sources []Source `yaml:"sources" json:"sources"` Reminders []Reminder `yaml:"reminders" json:"reminders"` Triggers []Trigger `yaml:"triggers" json:"triggers"` }
Article -
type CacheStorage ¶
CacheStorage -
func (CacheStorage) Get ¶
func (cs CacheStorage) Get(user, repo, branch, phase, stage, article, lang string) (Tip, bool)
Get -
func (CacheStorage) GetPathFromSlug ¶
func (cs CacheStorage) GetPathFromSlug(user, repo, branch, slug string) (string, bool)
GetPathFromSlug -
func (CacheStorage) GetSlug ¶
func (cs CacheStorage) GetSlug(user, repo, branch, slug, lang string) (Tip, bool)
GetSlug -
type Image ¶
type Image struct { URL string `yaml:"url" json:"url"` Layout string `yaml:"layout" json:"layout"` }
Image -
type Product ¶
type Product struct { Name string `yaml:"name" json:"name"` Urls []struct { Zone string `yaml:"zone" json:"zone"` Image string `yaml:"image" json:"image"` URL string `yaml:"url" json:"URL"` } }
Product -
type Reminder ¶
type Reminder struct { Delay string `yaml:"delay"` Text string `yaml:"text"` Next string `yaml:"next"` }
Reminder -
type Section ¶
type Section struct { Title string `yaml:"title" json:"title"` Image Image `yaml:"image" json:"image"` Text string `yaml:"text" json:"text"` SubSections []Section `yaml:"subsections" json:"subSections"` Link Link `yaml:"link" json:"link"` }
Section -
Click to show internal directories.
Click to hide internal directories.