package
0.0.0-20220330114152-ecdd364f93e8
Repository: https://github.com/ambientkit/plugin.git
Documentation: pkg.go.dev

# README

jshttprouter

Package jshttprouter is an Ambient plugin for a router using julienschmidt/httprouter.

Import: github.com/ambientkit/plugin/router/jshttprouter

Version: 1.0.0

Plugin Type

The plugin can be used as the following core types:

  • Logger: false
  • Storage System: false
  • Router: true
  • Template Engine: false
  • Session Manager: false

Grants

The plugin does not request any grants.

Settings

The plugin does not have any settings.

Routes

The plugin does not have any routes.

Middleware

The plugin does not have any middleware.

FuncMap

The plugin does not have a FuncMap.

Assets

The plugin does not inject any assets.

Embedded Files

The plugin does not have any embedded files.

Example Usage

package main

import (
	"log"

	"github.com/ambientkit/ambient"
	"github.com/ambientkit/ambient/pkg/ambientapp"
	"github.com/ambientkit/plugin/logger/zaplogger"
	"github.com/ambientkit/plugin/router/jshttprouter"
	"github.com/ambientkit/plugin/storage/memorystorage"
)

func main() {
	plugins := &ambient.PluginLoader{
		// Core plugins are implicitly trusted.
		Router:         jshttprouter.New(nil),
		TemplateEngine: nil,
		SessionManager: nil,
		// Trusted plugins are those that are typically needed to boot so they
		// will be enabled and given full access.
		TrustedPlugins: map[string]bool{},
		Plugins:        []ambient.Plugin{},
		Middleware:     []ambient.MiddlewarePlugin{
			// Middleware - executes top to bottom.
		},
	}
	_, _, err := ambientapp.NewApp("myapp", "1.0",
		zaplogger.New(),
		ambient.StoragePluginGroup{
			Storage: memorystorage.New(),
		},
		plugins)
	if err != nil {
		log.Fatalln(err.Error())
	}
}

Docgen by Ambient

# Packages

Package router provides request handling capabilities.

# Functions

New returns an Ambient plugin for a router using a variation of the way router.

# Structs

Plugin represents an Ambient plugin.