cyanocorax/model/page/page.go

25 lines
530 B
Go

package page
import (
"strings"
"time"
)
type Page struct {
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"`
}
func (p *Page) GetPage() string {
return strings.Join(p.Content, "\n")
}
func (p *Page) SetPage(newContent string) {
p.Content = strings.Split(newContent, "\n")
}