all repos — homestead @ f7d8beffaa09ecf863996d29c72f508eb3952c84

Code for my website

shared/storage/interface.go (view raw)

package storage

import (
	"alin.ovh/homestead/domain/content"
	"alin.ovh/homestead/shared/buffer"
)

type Reader interface {
	GetFile(path string) (*File, error)
	CanonicalisePath(path string) (string, bool)
}

type Writer interface {
	Mkdirp(path string) error

	NewFileFromPost(post *content.Post) *File

	Write(pathname string, title string, content *buffer.Buffer) error
	WritePost(post *content.Post, content *buffer.Buffer) error
	WriteFile(file *File, content *buffer.Buffer) error
}