Monitor

package
v0.0.0-...-91ca793 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COMMAND_ADDPAGE           = "AddPage"
	COMMAND_UPDATEPAGE        = "UpdatePage"
	COMMAND_DELETEPAGE        = "DeletePage"
	COMMAND_CREATEMARKDOWN    = "CreateMarkdown"
	COMMAND_COMPILE           = "Compile"
	COMMAND_EXPORTSOURCEPAGES = "ExportSourcePages"
	COMMAND_LISTOUTPUTPAGES   = "ListSourcePages"
	COMMAND_LISTPAGE          = "ListPage"
	COMMAND_ADDFILE           = "AddFile"
	COMMAND_DELETEFILE        = "DeleteFile"
	COMMAND_LISTFILE          = "ListFile"
)
View Source
const (
	MARKDOWNPAGE_METADATA_END = `[//]: # "METADATA_END_29b43fcf-5b71-4b15-a048-46765f5ef048"`
)

Variables

This section is empty.

Functions

func FindLink(sLink LinkPage, links []LinkPage) bool

func GetNormalFile

func GetNormalFile(files []NormalFile, filePath string) int

func IPSC_AddFile

func IPSC_AddFile(siteFolder, siteTitle, filePath string) (bool, error)

func IPSC_AddHtml

func IPSC_AddHtml(siteFolder, siteTitle, pagePath, pageTitle, pageAuthor, titleImage string, isTop bool) (string, bool, error)
func IPSC_AddLink(siteFolder, siteTitle, linkUrl, pageTitle, pageAuthor, titleImage string, isTop bool) (string, bool, error)

func IPSC_AddMarkdown

func IPSC_AddMarkdown(siteFolder, siteTitle, pagePath, pageTitle, pageAuthor, titleImage string, isTop bool) (string, bool, error)

ipsc -Command "AddPage" -SiteFolder -SiteTitle -PagePath -LinkUrl -PageType -PageTitle -PageAuthor -TitleImage -IsTop

func IPSC_Compile

func IPSC_Compile(siteFolder, siteTitle, indexPageSize string) (bool, error)

ipsc -Command "Compile" -SiteFolder "F:\TestSite" -SiteTitle "StarSite" -IndexPageSize "Normal"

func IPSC_CreateMarkdown

func IPSC_CreateMarkdown(siteFolder, siteTitle, pagePath, markdownType string) (bool, error)

ipsc -Command "CreateMarkdown" -SiteFolder "F:\TestSite" -SiteTitle "StarSite" -PagePath "F:\MarkdownWorkspace\_A1.md" -MarkdownType "News"

func IPSC_DeleteFile

func IPSC_DeleteFile(siteFolder, siteTitle, filePath string) (bool, error)

func IPSC_DeletePage

func IPSC_DeletePage(siteFolder, siteTitle, pageID string) (bool, error)

ipsc -Command "DeletePage" -SiteFolder "F:\TestSite" -SiteTitle "StarSite" -PageID "fc0f8d635ebb04d1c9393a722e8fc185" -RestorePage

func IPSC_ExportSite

func IPSC_ExportSite(siteFolder, siteTitle, exportFolder string) ([]MarkdownPage, []HtmlPage, []LinkPage, bool, error)

ipsc -Command "ExportSourcePages" -SiteFolder -SiteTitle -ExportFolder

func IPSC_ListFile

func IPSC_ListFile(siteFolder, siteTitle string) (bool, error)
func IPSC_UpdateLink(siteFolder, siteTitle, pageID, linkUrl, pageTitle, pageAuthor, titleImage string, isTop bool) (bool, error)

func IPSC_UpdateMarkdownOrHtml

func IPSC_UpdateMarkdownOrHtml(siteFolder, siteTitle, pageID, pagePath, pageTitle, pageAuthor, titleImage string, isTop bool) (bool, error)

func IsSiteMonitorEmpty

func IsSiteMonitorEmpty(sm SiteMonitor) bool

func LinkPage2String

func LinkPage2String(linkPage LinkPage) string

func Links2Json

func Links2Json(links []LinkPage) (string, error)

func RunIPSCCommand

func RunIPSCCommand(ipscCmd *exec.Cmd) (string, error)

func SaveLinksToFile

func SaveLinksToFile(filePath string, links []LinkPage) (bool, error)

Types

type HtmlPage

type HtmlPage struct {
	FilePath     string
	ID           string
	LastModified string
}

type HtmlProperties

type HtmlProperties struct {
	Title       string
	Author      string
	Description string
	IsTop       bool
}

func ReadHtmlProperties

func ReadHtmlProperties(filePath string) (*HtmlProperties, bool, error)

type LinkPage

type LinkPage struct {
	Url   string
	ID    string
	Title string
	IsTop bool
}

func ReadLinksFromFile

func ReadLinksFromFile(filePath string) ([]LinkPage, error)

type MarkdownPage

type MarkdownPage struct {
	FilePath     string
	ID           string
	LastModified string
}

type MarkdownProperties

type MarkdownProperties struct {
	Title       string
	Author      string
	Description string
	IsTop       bool
}

func ReadMarkdownPageProperties

func ReadMarkdownPageProperties(filePath string) (*MarkdownProperties, bool, error)

type NormalFile

type NormalFile struct {
	FileName     string
	FilePath     string
	LastModified string
}

func AddNormalFile

func AddNormalFile(files []NormalFile, file NormalFile) []NormalFile

func DeleteNormalFile

func DeleteNormalFile(files []NormalFile, file NormalFile) []NormalFile

func UpdateNormalFile

func UpdateNormalFile(files []NormalFile, file NormalFile) []NormalFile

type NormalFileSlice

type NormalFileSlice []NormalFile

func (NormalFileSlice) Len

func (s NormalFileSlice) Len() int

func (NormalFileSlice) Less

func (s NormalFileSlice) Less(i, j int) bool

func (NormalFileSlice) Swap

func (s NormalFileSlice) Swap(i, j int)

type SiteMonitor

type SiteMonitor struct {
	MonitorFolderPath    string
	SiteFolderPath       string
	SiteTitle            string
	LinkFileLastModified string

	MarkdownFiles []MarkdownPage
	HtmlFiles     []HtmlPage
	LinkFiles     []LinkPage
	NormalFiles   []NormalFile
}

func NewSiteMonitor

func NewSiteMonitor() *SiteMonitor

func NewSiteMonitor_WithArgs

func NewSiteMonitor_WithArgs(monitorFolderPath, siteFolderPath, siteTitle, linkLastModified string) *SiteMonitor

func (*SiteMonitor) AddHtml

func (smp *SiteMonitor) AddHtml(htmPage HtmlPage) (bool, error)

func (*SiteMonitor) AddHtml_Args

func (smp *SiteMonitor) AddHtml_Args(filePath, ID, lastModified string) (bool, error)
func (smp *SiteMonitor) AddLink(linkPage LinkPage) (bool, error)
func (smp *SiteMonitor) AddLink_Args(linkUrl, ID, linkTitle string, isTop bool) (bool, error)

func (*SiteMonitor) AddMarkdown

func (smp *SiteMonitor) AddMarkdown(mdPage MarkdownPage) (bool, error)

func (*SiteMonitor) AddMarkdown_Args

func (smp *SiteMonitor) AddMarkdown_Args(filePath, ID, lastModified string) (bool, error)

func (*SiteMonitor) DeleteHtml

func (smp *SiteMonitor) DeleteHtml(filePath string) (bool, error)
func (smp *SiteMonitor) DeleteLink(linkUrl string) (bool, error)

func (*SiteMonitor) DeleteMarkdown

func (smp *SiteMonitor) DeleteMarkdown(filePath string) (bool, error)

func (*SiteMonitor) FromJson

func (smp *SiteMonitor) FromJson(_jsonString string) (bool, error)

func (*SiteMonitor) GetHtml

func (smp *SiteMonitor) GetHtml(filePath string) int
func (smp *SiteMonitor) GetLink(linkUrl string) int

func (*SiteMonitor) GetMarkdown

func (smp *SiteMonitor) GetMarkdown(filePath string) int

func (*SiteMonitor) GetMonitorFilesFolderPath

func (smp *SiteMonitor) GetMonitorFilesFolderPath() string

func (*SiteMonitor) GetNormalFileList

func (smp *SiteMonitor) GetNormalFileList() NormalFileSlice

func (*SiteMonitor) LoadFromFile

func (smp *SiteMonitor) LoadFromFile(filePath string) (bool, error)

func (*SiteMonitor) SaveToFile

func (smp *SiteMonitor) SaveToFile(filePath string) (bool, error)

func (*SiteMonitor) ToJson

func (smp *SiteMonitor) ToJson() (string, error)

func (*SiteMonitor) UpdateHtml

func (smp *SiteMonitor) UpdateHtml(htmPage HtmlPage) (bool, error)

func (*SiteMonitor) UpdateHtml_Args

func (smp *SiteMonitor) UpdateHtml_Args(filePath, ID, lastModified string) (bool, error)
func (smp *SiteMonitor) UpdateLink(linkPage LinkPage) (bool, error)
func (smp *SiteMonitor) UpdateLink_Args(linkUrl, ID, linkTitle string, isTop bool) (bool, error)

func (*SiteMonitor) UpdateMarkdown

func (smp *SiteMonitor) UpdateMarkdown(mdPage MarkdownPage) (bool, error)

func (*SiteMonitor) UpdateMarkdown_Args

func (smp *SiteMonitor) UpdateMarkdown_Args(filePath, ID, lastModified string) (bool, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL