Documentation
¶
Index ¶
- Constants
- func BadRequest(c schema.Context, w http.ResponseWriter, title string, detail string)
- func DetailHandler(s schema.Server, m *schema.Model, w http.ResponseWriter, r *http.Request)
- func Forbidden(c schema.Context, w http.ResponseWriter, title string, detail string)
- func GetIntParam(params map[string][]string, key string, name string, defaultVal int, min *int, ...) (int, error)
- func GetStringParam(params map[string][]string, key string, name string, defaultVal string) (string, error)
- func InternalServerError(c schema.Context, w http.ResponseWriter)
- func ListHandler(s schema.Server, m *schema.Model, w http.ResponseWriter, r *http.Request)
- func MethodNotAllowed(c schema.Context, w http.ResponseWriter)
- func NotFound(c schema.Context, w http.ResponseWriter, model string, id string)
- func ParameterInfoHandler(s schema.Server, m *schema.Model, w http.ResponseWriter, r *http.Request)
- func RelationHandler(s schema.Server, m *schema.Model, relationship schema.Relationship, ...)
- func UniqueInstances(set []schema.Instance) []schema.Instance
- type CachedInstance
- type ContextTransaction
- func (t *ContextTransaction) Commit() error
- func (t *ContextTransaction) Exec(query string, args ...interface{}) (sql.Result, error)
- func (t *ContextTransaction) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (t *ContextTransaction) QueryRow(query string, args ...interface{}) *sql.Row
- func (t *ContextTransaction) Rollback() error
- type Error
- type Exception
- type IncludeResult
- type RelationResult
- type RequestContext
- func (rc *RequestContext) Authenticate() error
- func (rc *RequestContext) Begin() (schema.Transaction, error)
- func (rc *RequestContext) CacheObject(object schema.Instance, relationMap map[string]map[string][]string)
- func (rc *RequestContext) CanAccessAllInstances(instances []schema.Instance) bool
- func (rc *RequestContext) Exec(query string, args ...interface{}) (sql.Result, error)
- func (rc *RequestContext) FlushCache()
- func (rc *RequestContext) GetCachedObject(instanceType string, instanceId string) (schema.Instance, map[string]map[string][]string)
- func (rc *RequestContext) GetObjectsByFilter(m *schema.Model, whereQueries []string, whereArgs []interface{}, ...) ([]schema.Instance, []schema.Instance, error)
- func (rc *RequestContext) GetObjectsByIDs(m *schema.Model, objectIds []string, include *schema.Include) ([]schema.Instance, []schema.Instance, error)
- func (rc *RequestContext) GetObjectsByIDsAllRelations(m *schema.Model, objectIds []string, include *schema.Include) ([]schema.Instance, []schema.Instance, error)
- func (rc *RequestContext) GetQueryCount() int
- func (rc *RequestContext) GetRequest() *http.Request
- func (rc *RequestContext) GetServer() schema.Server
- func (rc *RequestContext) GetUser() schema.User
- func (rc *RequestContext) IncrementQueryCount()
- func (rc *RequestContext) InitCache()
- func (rc *RequestContext) LogQuery(query string)
- func (rc *RequestContext) LogStats()
- func (rc *RequestContext) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (rc *RequestContext) QueryRow(query string, args ...interface{}) *sql.Row
- func (rc *RequestContext) SetUser(user schema.User)
- func (rc *RequestContext) WriteToResponse(blob interface{})
- type Server
- func (s *Server) Authenticate(w http.ResponseWriter, r *http.Request, rc schema.Context) (schema.User, error)
- func (s *Server) DisableEasyJSON()
- func (s *Server) DisableSQLLogging()
- func (s *Server) DisableWhitespace()
- func (s *Server) EnableEasyJSON()
- func (s *Server) EnableSQLLogging()
- func (s *Server) EnableWhitespace()
- func (s *Server) GetDatabase() schema.Database
- func (s *Server) GetDefaultDirectPageSize() int
- func (s *Server) GetIndirectPageSize() int
- func (s *Server) GetMaximumDirectPageSize() int
- func (s *Server) GetModel(modelType string) *schema.Model
- func (s *Server) GetRoute(modelType string) string
- func (s *Server) Handle(router *mux.Router, modelType string, path string)
- func (s *Server) LogSQL() bool
- func (s *Server) RegisterModel(model *schema.Model)
- func (s *Server) SetDefaultDirectPageSize(size int)
- func (s *Server) SetIndirectPageSize(size int)
- func (s *Server) SetMaximumDirectPageSize(size int)
- func (s *Server) UseEasyJSON() bool
- func (s *Server) Whitespace() bool
Constants ¶
View Source
const ORDER_ARG = "order"
View Source
const USE_OBJECT_CACHE = true
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
func DetailHandler ¶
func GetIntParam ¶
func GetStringParam ¶
func InternalServerError ¶
func InternalServerError(c schema.Context, w http.ResponseWriter)
func ListHandler ¶
func MethodNotAllowed ¶
func MethodNotAllowed(c schema.Context, w http.ResponseWriter)
func ParameterInfoHandler ¶
func RelationHandler ¶
func RelationHandler( s schema.Server, m *schema.Model, relationship schema.Relationship, w http.ResponseWriter, r *http.Request, )
Types ¶
type CachedInstance ¶
type ContextTransaction ¶
type ContextTransaction struct {
// contains filtered or unexported fields
}
func (*ContextTransaction) Commit ¶
func (t *ContextTransaction) Commit() error
func (*ContextTransaction) Exec ¶
func (t *ContextTransaction) Exec(query string, args ...interface{}) (sql.Result, error)
func (*ContextTransaction) Query ¶
func (t *ContextTransaction) Query(query string, args ...interface{}) (*sql.Rows, error)
func (*ContextTransaction) QueryRow ¶
func (t *ContextTransaction) QueryRow(query string, args ...interface{}) *sql.Row
func (*ContextTransaction) Rollback ¶
func (t *ContextTransaction) Rollback() error
type IncludeResult ¶
type RelationResult ¶
type RequestContext ¶
type RequestContext struct { Server schema.Server Request *http.Request ResponseWriter http.ResponseWriter InstanceCache struct { sync.Mutex Instances map[string]map[string]CachedInstance } // contains filtered or unexported fields }
func NewRequestContext ¶
func NewRequestContext(s schema.Server, w http.ResponseWriter, r *http.Request) *RequestContext
func (*RequestContext) Authenticate ¶
func (rc *RequestContext) Authenticate() error
func (*RequestContext) Begin ¶
func (rc *RequestContext) Begin() (schema.Transaction, error)
func (*RequestContext) CacheObject ¶
func (*RequestContext) CanAccessAllInstances ¶
func (rc *RequestContext) CanAccessAllInstances(instances []schema.Instance) bool
func (*RequestContext) Exec ¶
func (rc *RequestContext) Exec(query string, args ...interface{}) (sql.Result, error)
func (*RequestContext) FlushCache ¶
func (rc *RequestContext) FlushCache()
func (*RequestContext) GetCachedObject ¶
func (*RequestContext) GetObjectsByFilter ¶
func (*RequestContext) GetObjectsByIDs ¶
func (*RequestContext) GetObjectsByIDsAllRelations ¶
func (*RequestContext) GetQueryCount ¶
func (rc *RequestContext) GetQueryCount() int
func (*RequestContext) GetRequest ¶
func (rc *RequestContext) GetRequest() *http.Request
func (*RequestContext) GetServer ¶
func (rc *RequestContext) GetServer() schema.Server
func (*RequestContext) GetUser ¶
func (rc *RequestContext) GetUser() schema.User
func (*RequestContext) IncrementQueryCount ¶
func (rc *RequestContext) IncrementQueryCount()
func (*RequestContext) InitCache ¶
func (rc *RequestContext) InitCache()
func (*RequestContext) LogQuery ¶
func (rc *RequestContext) LogQuery(query string)
func (*RequestContext) LogStats ¶
func (rc *RequestContext) LogStats()
func (*RequestContext) Query ¶
func (rc *RequestContext) Query(query string, args ...interface{}) (*sql.Rows, error)
func (*RequestContext) QueryRow ¶
func (rc *RequestContext) QueryRow(query string, args ...interface{}) *sql.Row
func (*RequestContext) SetUser ¶
func (rc *RequestContext) SetUser(user schema.User)
func (*RequestContext) WriteToResponse ¶
func (rc *RequestContext) WriteToResponse(blob interface{})
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Authenticate ¶
func (*Server) DisableEasyJSON ¶
func (s *Server) DisableEasyJSON()
func (*Server) DisableSQLLogging ¶
func (s *Server) DisableSQLLogging()
func (*Server) DisableWhitespace ¶
func (s *Server) DisableWhitespace()
func (*Server) EnableEasyJSON ¶
func (s *Server) EnableEasyJSON()
func (*Server) EnableSQLLogging ¶
func (s *Server) EnableSQLLogging()
func (*Server) EnableWhitespace ¶
func (s *Server) EnableWhitespace()
func (*Server) GetDatabase ¶
func (*Server) GetDefaultDirectPageSize ¶
func (*Server) GetIndirectPageSize ¶
func (*Server) GetMaximumDirectPageSize ¶
func (*Server) RegisterModel ¶
func (*Server) SetDefaultDirectPageSize ¶
func (*Server) SetIndirectPageSize ¶
func (*Server) SetMaximumDirectPageSize ¶
func (*Server) UseEasyJSON ¶
func (*Server) Whitespace ¶
Click to show internal directories.
Click to hide internal directories.