Documentation
¶
Index ¶
Constants ¶
View Source
const FileName = "_state.json"
FileName is the name of the state file in each blog directory.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostEntry ¶
type PostEntry struct {
Title string `json:"title"`
DirName string `json:"dirName"`
DownloadedAt string `json:"downloadedAt"`
UpdatedAt int64 `json:"updatedAt,omitempty"`
CommentsCount int `json:"commentsCount"`
Price int `json:"price"`
Tier string `json:"tier,omitempty"`
Locked bool `json:"locked,omitempty"`
HasComments bool `json:"hasComments"`
HasMd bool `json:"hasMd"`
}
PostEntry records metadata about a downloaded post.
type State ¶
type State struct {
Posts map[string]PostEntry `json:"posts"`
LastSync string `json:"lastSync"`
// contains filtered or unexported fields
}
State tracks which posts have been downloaded for a blog.
func Load ¶
Load reads the state file from the given directory. Returns an empty state if the file doesn't exist or is invalid.
Click to show internal directories.
Click to hide internal directories.