blueprint

package module
v0.0.0-...-f7b13be Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

README

blueprint

Documentation

Overview

Package blueprint provides a set of interfaces for developing Go applications with clean framework design in mind. The package blueprint is a "kit" of common framework abstractions. At github.com/blueprint you can also find some implimentations for these interfaces. You are always invited to write your own implimentations, or plugins for external libraries.

Package render writes HTTP responses in different formats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON

func JSON(w http.ResponseWriter, code int, pretty bool, v interface{}) (int, error)

JSON writes an object to a http.ResponseWriter as JSON.

func JSONP

func JSONP(w http.ResponseWriter, code int, pretty bool, callback string, v interface{}) (int, error)

JSONP wraps a callback function around an object and writes the result to a http.ResponseWriter as JSONP.

func XML

func XML(w http.ResponseWriter, code int, pretty bool, v interface{}) (int, error)

XML writes an object to a http.ResponseWriter as XML.

func YML

func YML(w http.ResponseWriter, code int, v interface{}) (int, error)

YML writes an object to a http.ResponseWriter as YML.

Types

type Database

type Database interface {
	Dial(name string) error
	Name() string
	Close()
}

Database describes a methods to connect and close database connections.

type Model

type Model interface {
	New() Model
	PathID() string
	SetID(id string) error
	FindAll() ([]Model, error)
	FindByID(id string) error
	FindAllByOwner(owner Model) ([]Model, error)
	BelongsTo(owner Model) error
	Save() error
	Delete() error
	Validate() error
}

Model represents a data model used by resource controllers to automate RESTful CRUD operations.

type Serializer

type Serializer interface {
	Serialize(io.Writer, interface{}) (int, error)
}

type SerializerFunc

type SerializerFunc func(io.Writer, interface{}) (int, error)

func (SerializerFunc) Serialize

func (s SerializerFunc) Serialize(w io.Writer, v interface{}) (int, error)

Directories

Path Synopsis
Package bootstrap bootstraps configuration, databases, and servers.
Package bootstrap bootstraps configuration, databases, and servers.
Package dba is an singleton that manages databases as would a Database Administrator.
Package dba is an singleton that manages databases as would a Database Administrator.
examples
swagger
@APIVersion 1.0.0 @APITitle Gophersaurus Example Swagger API @APIDescription This API is an example to demonstrate Swagger capabilities.
@APIVersion 1.0.0 @APITitle Gophersaurus Example Swagger API @APIDescription This API is an example to demonstrate Swagger capabilities.
Package middleware provides out-of-the-box options for middlware.
Package middleware provides out-of-the-box options for middlware.
Package mock contains useful convenience methods to mock objects for testing.
Package mock contains useful convenience methods to mock objects for testing.
Package resource automates CRUD via resource controllers.
Package resource automates CRUD via resource controllers.
router
swagger
Package docs generates endpoint documentation.
Package docs generates endpoint documentation.

Jump to

Keyboard shortcuts

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