mdlog

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUpToDate = errors.New("local posts is up to date with remote posts")
)

Functions

func PostStatusText added in v0.2.0

func PostStatusText(status PostStatus) string

func String

func String(s string) *string

Types

type Blog

type Blog interface {
	GetPosts() ([]*Post, error)
	Update(post *Post) error
	CreatePost() (*Post, error)
}

type Plan added in v0.2.0

type Plan map[*Post]*Post

func (Plan) Print added in v0.2.0

func (p Plan) Print()

type Post

type Post struct {
	ID      string
	Title   string
	Content string
	Tags    []string
	Status  PostStatus
}

func ParsePost

func ParsePost(md []byte) (*Post, error)

func (*Post) Equal

func (p *Post) Equal(p2 *Post) bool

func (*Post) Validate

func (p *Post) Validate() error

type PostStatus

type PostStatus int
const (
	PostStatusDraft PostStatus = iota
	PostStatusPublished
)

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(blog Blog) *Service

func (*Service) Create

func (s *Service) Create() (*Post, error)

func (*Service) Plan

func (s *Service) Plan(localPosts []*Post) (Plan, error)

func (*Service) Sync

func (s *Service) Sync(localPosts []*Post) (Plan, error)

Jump to

Keyboard shortcuts

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