storage

package
v0.0.0-...-a9c5b8f Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSuchRevision = errors.New("no such revision")
	ErrNoSuchLocale   = errors.New("no such locale")
	ErrNoSuchSubtopic = errors.New("no such subtopic")
)

Functions

This section is empty.

Types

type PathTopic

type PathTopic interface {
	Topic

	// Subtopic returns a subtopic in a given path
	Subtopic(path string) (Topic, error)
}

PathTopic is a Topic that can be queried by a path

type Revision

type Revision string
const DefaultRevision Revision = "master"

type Storage

type Storage interface {
	Root(revision Revision) (Topic, error)
	Sync()
	GetRevisions() []Revision
}

func NewFSStorage

func NewFSStorage(path string) Storage

NewFSStorage return an implementation of storage that uses a directory in the filesystem

type Topic

type Topic interface {
	// ID returns an un-localized name for the article
	ID() string

	// Locales returns all available locales
	Locales() []string

	// Name returns the localized Name
	Name(locale string) (string, error) // non-unique name

	// Data returns a rewinded io.Reader delivering the markdown code
	Data(locale string) (io.Reader, error) // link

	// Subtopics returns the subtopics of the topic
	Subtopics() []Topic // subtopics
}

Topic depicts an article and its subtopics

Jump to

Keyboard shortcuts

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