Documentation ¶
Overview ¶
Package samb has server-assembly's (SAMB) struct types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Documentation ¶ added in v0.0.4
type Documentation struct { // Comment is used // with documentation // generation. Comment string // Alias specifies how the resource // should be used. Alias string }
Documentation will be used to generate HTML documentation of your code.
type Project ¶
type Project struct { Server Server Require, Import []string // Provider defines the providers // to be used by HTTP routes. Provider []Global Package string Author string Packages []string Routes Routes Templates Templates Global []Global }
Project has your samb
directives.
func (*Project) GetProvider ¶
GetProvider gets a provider from a project, based on the name passed. It is recommended to check for a provider with local function HasProvider prior to getting it.
func (*Project) HasProvider ¶
HasProvider checks to see if the project has a provider with the specified name.
func (*Project) ProcessImports ¶
func (p *Project) ProcessImports()
ProcessImports handles finding and merging imports defined by project.
type Route ¶
type Route struct {
Method, Path string
// Provide is a list of
// provider names to be used by request.
Provide []string
Route []Route
Handler string
// Go specifies Go code
// to be ran prior to invocation
// of handler. This code must respect
// the scope of a Go HTTP handler function,
// with variables r and w in scope.
Go Go
Doc Documentation
// Strict specifies
// if route should only be invoked
// if the request path matches this
// routes' path
Strict bool
// Require will import and nest the
// routes from the specified SAMB sources.
Require []string
}
Route specifies the contract needed to be met by a request, and the handler (Go code) to be executed.
type Routes ¶
type Routes struct { Route []Route Provide []string Doc Documentation }
Routes holds a group of HTTP routes.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
package tools has functions that automatically format Go syntax and add import paths.
|
package tools has functions that automatically format Go syntax and add import paths. |
Package transpiler converts samb struct types into Go code.
|
Package transpiler converts samb struct types into Go code. |
Click to show internal directories.
Click to hide internal directories.