source

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS struct {
	// contains filtered or unexported fields
}

FS loads the website data from the file system.

func NewFS

func NewFS(dir string, updateSeconds int) *FS

NewFS creates a new Provider for the file system.

func (*FS) LastUpdate

func (provider *FS) LastUpdate() time.Time

LastUpdate implements the Provider interface.

func (*FS) Update

func (provider *FS) Update(ctx context.Context, update func())

Update implements the Provider interface.

type Git

type Git struct {
	// contains filtered or unexported fields
}

Git loads the website data from a Git repository.

func NewGit

func NewGit(dir, repository string, updateSeconds int) *Git

NewGit creates a new Provider for Git.

func (*Git) LastUpdate

func (provider *Git) LastUpdate() time.Time

LastUpdate implements the Provider interface.

func (*Git) Update

func (provider *Git) Update(ctx context.Context, update func())

Update implements the Provider interface.

type Provider

type Provider interface {
	// Update regularly updates the website data from Git.
	Update(context.Context, func())

	// LastUpdate returns the time the website data has last been updated.
	LastUpdate() time.Time
}

Provider is the interface for a website data provider.

Jump to

Keyboard shortcuts

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