hello

package
v0.0.0-...-ecdd364 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package hello provides a hello page for an Ambient app.

Index

Constants

View Source
const (
	// Username allows user to set the login username.
	Username = "Username"
	// SafeMode is a boolean value.
	SafeMode = "Safe Mode"
)

Variables

This section is empty.

Functions

func Get

func Get(r *http.Request) string

Get returns the request value from the request context.

func Set

func Set(r *http.Request, value string) *http.Request

Set the value in the request context.

Types

type ContextKey

type ContextKey string

ContextKey is a context key.

type Plugin

type Plugin struct {
	*ambient.PluginBase
}

Plugin represents an Ambient plugin.

func New

func New() *Plugin

New returns a new hello plugin.

func (*Plugin) Assets

func (p *Plugin) Assets() ([]ambient.Asset, ambient.FileSystemReader)

Assets returns a list of assets and an embedded filesystem.

func (*Plugin) Enable

func (p *Plugin) Enable(toolkit *ambient.Toolkit) error

Enable accepts the toolkit.

func (*Plugin) FuncMap

func (p *Plugin) FuncMap() func(r *http.Request) template.FuncMap

FuncMap returns a callable function that accepts a request.

func (*Plugin) GrantRequests

func (p *Plugin) GrantRequests() []ambient.GrantRequest

GrantRequests returns a list of grants requested by the plugin.

func (*Plugin) Middleware

func (p *Plugin) Middleware() []func(next http.Handler) http.Handler

Middleware returns router middleware.

func (*Plugin) PluginName

func (p *Plugin) PluginName() string

PluginName returns the plugin name.

func (*Plugin) PluginVersion

func (p *Plugin) PluginVersion() string

PluginVersion returns the plugin version.

func (*Plugin) Routes

func (p *Plugin) Routes()

Routes sets routes for the plugin.

func (*Plugin) Settings

func (p *Plugin) Settings() []ambient.Setting

Settings returns a list of user settable fields.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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