commentary

package
v0.0.0-...-8c0d604 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultRepo = CommentaryRepo{
	GitUrl: "gitlab.com/laleo-language/sblgnt-commentary",
}

Functions

func CreateTempGitRepo

func CreateTempGitRepo() (string, error)

func Path

func Path(ref Ref) (string, string)

func ReadCommentary

func ReadCommentary(r io.Reader, c *VerseCommentary) error

func WriteCommentary

func WriteCommentary(w io.Writer, c VerseCommentary) error

Types

type CommentaryRepo

type CommentaryRepo struct {
	GitUrl    string
	LocalRepo string
	// contains filtered or unexported fields
}

func (*CommentaryRepo) GetCommentary

func (cfg *CommentaryRepo) GetCommentary(cref Ref) (io.ReadCloser, error)

GetCommentary will return a ReadCloser with the contents of the commentary file. If cref.Language is empty, it defaults to English. If there is no commentary available for the given reference, it will return object.ErrFileNotFound.

func (*CommentaryRepo) Open

func (cfg *CommentaryRepo) Open() error

func (*CommentaryRepo) WriteCommentary

func (cfg *CommentaryRepo) WriteCommentary(cref Ref, cmnt VerseCommentary, sig Signature) error

Note that cmnt.Meta.Version will be ignored

type Ref

type Ref struct {
	Language language.Tag
	Book     sblgnt.BookName
	Chapter  int
	Verse    int
}

func (Ref) String

func (ref Ref) String() string

type Signature

type Signature struct {
	Name  string
	Email string
}

type VerseCommentary

type VerseCommentary struct {
	Meta       VerseMetadata
	Commentary []byte
}

type VerseMetadata

type VerseMetadata struct {
	Version int
}

Jump to

Keyboard shortcuts

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