cyanocorax/model/page/page.go

25 lines
530 B
Go
Raw Permalink Normal View History

2022-02-14 10:26:10 +01:00
package page
import (
"strings"
2022-02-14 19:21:31 +01:00
"time"
2022-02-14 10:26:10 +01:00
)
type Page struct {
2022-02-14 19:21:31 +01:00
Title string `json:"title"`
Content []string `json:"content"`
Authors []string `json:"authors"`
Tags []string `json:"tags"`
DateEdit time.Time `json:"dateEdit"`
DateCreate time.Time `json:"dateCreate"`
DatePublish time.Time `json:"datePublish"`
2022-02-14 10:26:10 +01:00
}
func (p *Page) GetPage() string {
return strings.Join(p.Content, "\n")
}
func (p *Page) SetPage(newContent string) {
p.Content = strings.Split(newContent, "\n")
}