Versions in this module Expand all Collapse all v0 v0.1.0 Jan 6, 2019 Changes in this version + var ErrCreateDocument = errors.New("failed to create document") + var ErrDocumentExists = errors.New("document already exists") + var ErrDocumentNotExists = errors.New("document not exists") + var ErrGetDocument = errors.New("failed to open document") + var ErrInitFailed = errors.New("failed to initialize repository") + var ErrInitNotEmpty = errors.New("path to initialized not empty") + var ErrInvalidOption = errors.New("invalid option") + type CompareOutputOption int8 + const CompareOutputHTML + const CompareOutputText + type Document struct + Body string + ID string + Revision DocumentRevision + type DocumentRevision struct + Hash string + UpdatedAt *time.Time + type InitOptions struct + AuthorEmail string + AuthorName string + Path string + type Repository struct + func Init(opt *InitOptions) (*Repository, error) + func (r *Repository) CompareDocumentRevisions(id, revHashFrom, revHashTo string, typ CompareOutputOption) (string, error) + func (r *Repository) CreateDocument(id string, body string) (*Document, error) + func (r *Repository) GetDocument(id string) (*Document, error) + func (r *Repository) GetDocumentAtRevision(id string, revisionHash string) (*Document, error) + func (r *Repository) GetDocumentIDs() ([]string, error) + func (r *Repository) GetDocumentRevisions(id string) ([]DocumentRevision, error) + func (r *Repository) UpdateDocument(id string, newBody string) (*Document, error)