dojo

package module
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: MIT Imports: 18 Imported by: 0

README

Dojo | Framework

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Name        string `json:"name"`
	Version     string `json:"version"`
	Port        int    `json:"port"`
	Environment string `json:"environment"`
	Domain      string `json:"domain"`
}

type Application

type Application struct {
	Configuration DefaultConfiguration
	Middleware    *MiddlewareStack `json:"-"`
	// contains filtered or unexported fields
}

func New

New creates a new instance of Application

func (*Application) Assets added in v0.0.6

func (app *Application) Assets() []Asset

func (*Application) GET added in v0.0.4

func (app *Application) GET(p string, h Handler)

func (Application) NewContext added in v0.0.4

func (app Application) NewContext(rc RouteConfig, w http.ResponseWriter, r *http.Request) Context

func (*Application) Serve

func (app *Application) Serve()

func (*Application) Use added in v0.0.4

func (app *Application) Use(mw ...MiddlewareFunc)

func (Application) View added in v0.0.4

func (app Application) View(ctx Context, viewName string, data ViewData)

type Asset added in v0.0.6

type Asset struct {
	Name      string
	Extension FileExtension
}

type AssetsConfigs added in v0.0.6

type AssetsConfigs struct {
	Path string `json:"path"`
}

type Context

type Context interface {
	context.Context
	Response() http.ResponseWriter
	Request() *http.Request
}

type DatabaseConfig

type DatabaseConfig struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	User     string `json:"user"`
	Password string `json:"password"`
	Database string `json:"database"`
}

type DefaultConfiguration

type DefaultConfiguration struct {
	App    AppConfig
	DB     DatabaseConfig
	View   ViewConfig
	Assets AssetsConfigs
}

type DefaultContext added in v0.0.4

type DefaultContext struct {
	context.Context
	// contains filtered or unexported fields
}

func (*DefaultContext) Params added in v0.0.4

func (d *DefaultContext) Params() ParamValues

func (*DefaultContext) Request added in v0.0.4

func (d *DefaultContext) Request() *http.Request

Request returns the original Request.

func (*DefaultContext) Response added in v0.0.4

func (d *DefaultContext) Response() http.ResponseWriter

Response returns the original Response for the request.

type FileExtension added in v0.0.6

type FileExtension string
const (
	Javascript FileExtension = "js"
	Stylesheet FileExtension = "css"
)

type Handler

type Handler func(ctx Context) error

type MiddlewareFunc added in v0.0.4

type MiddlewareFunc func(Handler) Handler

type MiddlewareStack added in v0.0.4

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

func (*MiddlewareStack) Use added in v0.0.4

func (ms *MiddlewareStack) Use(mw ...MiddlewareFunc)

type ParamValues added in v0.0.4

type ParamValues interface {
	Get(string) string
}

type RouteConfig added in v0.0.4

type RouteConfig struct {
	Method       string       `json:"method"`
	Path         string       `json:"path"`
	HandlerName  string       `json:"handler"`
	ResourceName string       `json:"resourceName,omitempty"`
	PathName     string       `json:"pathName"`
	Aliases      []string     `json:"aliases"`
	MuxRoute     *mux.Route   `json:"-"`
	Handler      Handler      `json:"-"`
	App          *Application `json:"-"`
}

func (RouteConfig) ServeHTTP added in v0.0.4

func (r RouteConfig) ServeHTTP(res http.ResponseWriter, req *http.Request)

type ViewConfig added in v0.0.4

type ViewConfig struct {
	Path string `json:"path"`
}

type ViewData added in v0.0.4

type ViewData map[string]interface{}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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