scriptlet

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0, BSD-2-Clause-Views, BSD-3-Clause, + 4 more Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Injector

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

Injector injects scriptlets into HTML HTTP responses.

func NewInjector

func NewInjector(store Store) (*Injector, error)

NewInjector creates a new Injector with the embedded scriptlets.

func (*Injector) AddRule

func (inj *Injector) AddRule(rule string, filterListTrusted bool) error

func (*Injector) Inject

func (inj *Injector) Inject(req *http.Request, res *http.Response) error

Inject injects scriptlets into a given HTTP HTML response.

On error, the caller may proceed as if the function had not been called.

type Scriptlet

type Scriptlet struct {
	Name string
	Args []string
}

func (*Scriptlet) GenerateInjection

func (r *Scriptlet) GenerateInjection(w io.Writer) error

type Store

type Store interface {
	Add(hostnames []string, scriptlet *Scriptlet)
	Get(hostname string) []*Scriptlet
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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