viewer

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Perf added in v0.0.2

type Perf struct {
	Stages []stats.StageStats
	Index  igraph.Stats
	Now    perf.Snapshot
}

Perf represents viewer performance

type ProgressMessage added in v0.0.2

type ProgressMessage struct {
	Message  string
	Progress stats.Progress
}

ProgressMessage is returned by the viewer when the progress is not available

type RenderFlags

type RenderFlags struct {
	PublicURL   string
	Predicates  sparkl.Predicates
	StrictCSP   bool // use strict content-security-policy for images and media by only allowing content from public uris
	HTMLRender  bool
	ImageRender bool

	// Stats holds the status to use for logging
	Stats *stats.Stats
}

func (RenderFlags) CSPHeader

func (rf RenderFlags) CSPHeader() string

CSPHeader returns the CSPHeader to be included in viewer responses

func (RenderFlags) PublicURIS

func (rf RenderFlags) PublicURIS() (public []string)

type Viewer

type Viewer struct {
	Stats *stats.Stats // Stats holds the current stats of the viewer

	Cache       *sparkl.Cache
	Pathbuilder *pathbuilder.Pathbuilder
	RenderFlags RenderFlags

	Footer template.HTML // html to include in footer of every page
	// contains filtered or unexported fields
}

Viewer implements an http.Handler that displays WissKI Entities.

func NewViewer added in v0.0.2

func NewViewer(writer io.Writer) *Viewer

NewViewer creates a new viewer that logs to the given output

func (*Viewer) Close

func (viewer *Viewer) Close() error

func (*Viewer) Perf added in v0.0.2

func (viewer *Viewer) Perf() Perf

func (*Viewer) Prepare

func (viewer *Viewer) Prepare(cache *sparkl.Cache, pb *pathbuilder.Pathbuilder)

func (*Viewer) ServeHTTP

func (viewer *Viewer) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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