repository

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

Backend implements the Backender interface. It fetches and constructs SEO page data responses from an external backend.

func NewBackend

func NewBackend(cfg *config.Cache) *Backend

NewBackend creates a new instance of Backend.

func (*Backend) Fetch

func (s *Backend) Fetch(ctx context.Context, req *model.Request) (*model.Response, error)

Fetch method fetches page data for the given request and constructs a cacheable response. It also attaches a revalidator closure for future background refreshes.

func (*Backend) RevalidatorMaker

func (s *Backend) RevalidatorMaker(req *model.Request) func(ctx context.Context) (*model.Data, error)

RevalidatorMaker builds a new revalidator for model.Response by catching a request into closure for be able to call backend later.

type Backender

type Backender interface {
	Fetch(ctx context.Context, req *model.Request) (*model.Response, error)
	RevalidatorMaker(req *model.Request) func(ctx context.Context) (*model.Data, error)
}

Backender defines the interface for a repository that provides SEO page data.

Jump to

Keyboard shortcuts

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