source

package
v1.0.0-preview-1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 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 FileSystem added in v0.12.0

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

FileSystem loads the website data from the file system.

func NewFileSystem added in v0.12.0

func NewFileSystem(dir string, updateSeconds int) *FileSystem

NewFileSystem creates a new Provider for the file system.

func (*FileSystem) LastUpdate added in v0.12.0

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

LastUpdate implements the Provider interface.

func (*FileSystem) Update added in v0.12.0

func (provider *FileSystem) Update(update func())

Update implements the Provider interface.

func (*FileSystem) Watch added in v0.12.0

func (provider *FileSystem) Watch(ctx context.Context, update func())

Watch 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(update func())

Update implements the Provider interface.

func (*Git) Watch added in v0.12.0

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

Watch implements the Provider interface.

type Provider

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

	// Update updates the website data once.
	Update(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