esv

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const AuthFile = ".esv.yaml"

AuthFile is the location where the local project should stash the ESV access key file.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	// AccessKey is the ESV API access key.
	AccessKey string `yaml:"access_key"`
}

Auth is the structure of the ESV access key file.

func LoadAuth

func LoadAuth(path string) (*Auth, error)

LoadAuth loads the ESV access key file.

type Resolver

type Resolver struct {
	*esv.Client
}

func New

func New(auth *Auth) *Resolver

func NewFromAuthFile

func NewFromAuthFile(path string) (*Resolver, error)

func NewFromEnvironment

func NewFromEnvironment() (*Resolver, error)

func (*Resolver) Verse

func (r *Resolver) Verse(ctx context.Context, ref *ref.Resolved) (*text.Verse, error)

Verse fetches a verse an associated metadata for the given reference.

func (*Resolver) VerseHTML

func (r *Resolver) VerseHTML(ctx context.Context, ref *ref.Resolved) (template.HTML, error)

VerseHTML returns the HTML of the given verse reference using the ESV API.

func (*Resolver) VerseText added in v0.4.0

func (r *Resolver) VerseText(ctx context.Context, ref *ref.Resolved) (string, error)

VerseText returns the text of the given verse reference using the ESV API.

func (*Resolver) VersionInformation added in v0.4.0

func (r *Resolver) VersionInformation(context.Context) (*text.Version, error)

VersionInformation returns the metadata for the ESV from esv.org.

Jump to

Keyboard shortcuts

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