all repos — homestead @ 72b4c0f972a3bdb1a5bec19544d828f2942a6fab

Code for my website

internal/storage/interface.go (view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package storage

import (
	"go.alanpearce.eu/homestead/internal/buffer"
	"go.alanpearce.eu/homestead/internal/content"
)

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

type Writer interface {
	Mkdirp(path string) error

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