mount

package
v0.9.0-rc.53 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mount hands a path prefix to another program on this machine, and tells that program who the reader is.

Index

Constants

View Source
const (
	NotifyPath      = "/pw-api/mounts/notify"
	MountHeader     = "X-Pwikit-Mount"
	SignatureHeader = "X-Pwikit-Signature"
)
View Source
const UserHeader = "X-Pwikit-User"

UserHeader carries the signed reader. Whatever the client sent under this name, or under any other X-Pwikit- header, is dropped before forwarding.

Variables

This section is empty.

Functions

func New

func New(c Config, log *slog.Logger) (http.Handler, error)

func NotifyHandler

func NotifyHandler(secrets map[string]string, sender Sender) http.Handler

NotifyHandler lets a mounted program tell readers something through the wiki's own notices. A program proves which mount it is with that mount's key, so it can only ever speak as itself.

func Signature

func Signature(secret, body string) string

Types

type Config

type Config struct {
	Path        string
	Upstream    string
	StripPrefix bool
	Secret      string
}

type Sender

type Sender interface {
	SendNotification(ctx context.Context, siteID int64, kind, meta string, recipients []int64, at time.Time) error
}

Jump to

Keyboard shortcuts

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