ambientapp

package
v0.0.0-...-545971b Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: MIT Imports: 14 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAppLogger

func NewAppLogger(appName string, appVersion string, logPlugin ambient.LoggingPlugin, logLevel ambient.LogLevel) (ambient.AppLogger, error)

NewAppLogger returns a logger from Ambient without all the other dependencies.

Types

type App

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

App represents an Ambient app that supports plugins.

func NewApp

func NewApp(appName string, appVersion string, logPlugin ambient.LoggingPlugin,
	storagePluginGroup ambient.StoragePluginGroup, plugins *ambient.PluginLoader) (*App, ambient.AppLogger, error)

NewApp returns a new Ambient app that supports plugins.

func (*App) CleanUp

func (app *App) CleanUp()

CleanUp runs the final steps to ensure the server shutdown doesn't leave the app in a bad state.

func (*App) Handler

func (app *App) Handler() (http.Handler, error)

Handler loads the plugins and returns the handler.

func (*App) ListenAndServe

func (app *App) ListenAndServe(h http.Handler) error

ListenAndServe will start the web listener on port 8080 or will pull the environment variable from: PORT (GCP), _LAMBDA_SERVER_PORT (AWS), or FUNCTIONS_CUSTOMHANDLER_PORT (Azure).

func (*App) PluginSystem

func (app *App) PluginSystem() ambient.PluginSystem

PluginSystem returns the plugin system.

func (*App) SecureSite

func (app *App) SecureSite() *secureconfig.SecureSite

SecureSite returns the secure site configuration.

func (*App) SetDebugTemplates

func (app *App) SetDebugTemplates(enable bool)

SetDebugTemplates sets the injector to enable verbose debug output in templates.

func (*App) SetEscapeTemplates

func (app *App) SetEscapeTemplates(enable bool)

SetEscapeTemplates sets the injector to disable (enabled by default) escaping templates.

func (*App) SetLogLevel

func (app *App) SetLogLevel(level ambient.LogLevel)

SetLogLevel sets the log level.

func (*App) StopGRPCClients

func (app *App) StopGRPCClients()

StopGRPCClients stops the gRPC plugins.

Jump to

Keyboard shortcuts

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