Documentation
¶
Index ¶
- func AddResourcesToApi2Go(api *api2go.API, tables []resource.TableInfo, db *sqlx.DB, ...) map[string]*resource.DbResource
- func BuildMiddlewareSet(cmsConfig *resource.CmsConfig) resource.MiddlewareSet
- func CleanUpConfigFiles()
- func CorsMiddlewareFunc(c *gin.Context)
- func CreateConfigHandler(configStore *resource.ConfigStore) func(context *gin.Context)
- func CreateEventHandler(initConfig *resource.CmsConfig, fsmManager resource.FsmManager, ...) func(context *gin.Context)
- func CreateEventStartHandler(fsmManager resource.FsmManager, cruds map[string]*resource.DbResource, ...) func(context *gin.Context)
- func CreateJsModelHandler(initConfig *resource.CmsConfig) func(*gin.Context)
- func GetActionPerformers(initConfig *resource.CmsConfig, configStore *resource.ConfigStore) []resource.ActionPerformerInterface
- func GetTablesFromWorld(db *sqlx.DB) ([]resource.TableInfo, error)
- func Main()
- func NewStateMachineEvent(machineId string, eventName string) resource.StateMachineEvent
- type CorsInfo
- type CorsMiddleware
- type JsModel
- type JsonApiRelation
- type ManualResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddResourcesToApi2Go ¶
func AddResourcesToApi2Go(api *api2go.API, tables []resource.TableInfo, db *sqlx.DB, ms *resource.MiddlewareSet, configStore *resource.ConfigStore) map[string]*resource.DbResource
func BuildMiddlewareSet ¶
func BuildMiddlewareSet(cmsConfig *resource.CmsConfig) resource.MiddlewareSet
func CleanUpConfigFiles ¶
func CleanUpConfigFiles()
func CorsMiddlewareFunc ¶
func CreateConfigHandler ¶
func CreateConfigHandler(configStore *resource.ConfigStore) func(context *gin.Context)
func CreateEventHandler ¶
func CreateEventStartHandler ¶
func CreateEventStartHandler(fsmManager resource.FsmManager, cruds map[string]*resource.DbResource, db *sqlx.DB) func(context *gin.Context)
func CreateJsModelHandler ¶
func GetActionPerformers ¶
func GetActionPerformers(initConfig *resource.CmsConfig, configStore *resource.ConfigStore) []resource.ActionPerformerInterface
func NewStateMachineEvent ¶
func NewStateMachineEvent(machineId string, eventName string) resource.StateMachineEvent
Types ¶
type CorsInfo ¶
type CorsInfo struct {
IsCors bool
IsPreflight bool
Origin string
OriginUrl *url.URL
// The header value is converted to uppercase to avoid common mistakes.
AccessControlRequestMethod string
// The header values are normalized with http.CanonicalHeaderKey.
AccessControlRequestHeaders []string
}
func GetCorsInfo ¶
type CorsMiddleware ¶
type CorsMiddleware struct {
// Reject non CORS requests if true. See CorsInfo.IsCors.
RejectNonCorsRequests bool
// Function excecuted for every CORS requests to validate the Origin. (Required)
// Must return true if valid, false if invalid.
// For instance: simple equality, regexp, DB lookup, ...
OriginValidator func(origin string, request *http.Request) bool
// List of allowed HTTP methods. Note that the comparison will be made in
// uppercase to avoid common mistakes. And that the
// Access-Control-Allow-Methods response header also uses uppercase.
// (see CorsInfo.AccessControlRequestMethod)
AllowedMethods []string
// List of allowed HTTP Headers. Note that the comparison will be made with
// noarmalized names (http.CanonicalHeaderKey). And that the response header
// also uses normalized names.
// (see CorsInfo.AccessControlRequestHeaders)
AllowedHeaders []string
// List of headers used to set the Access-Control-Expose-Headers header.
AccessControlExposeHeaders []string
// User to se the Access-Control-Allow-Credentials response header.
AccessControlAllowCredentials bool
// Used to set the Access-Control-Max-Age response header, in seconds.
AccessControlMaxAge int
// contains filtered or unexported fields
}
CorsMiddleware provides a configurable CORS implementation.
func (*CorsMiddleware) MiddlewareFunc ¶
func (mw *CorsMiddleware) MiddlewareFunc(handler http.HandlerFunc) http.HandlerFunc
MiddlewareFunc makes CorsMiddleware implement the Middleware interface.
type JsonApiRelation ¶
type JsonApiRelation struct {
JsonApi string `json:"jsonApi,omitempty"`
ColumnType string `json:"columnType"`
Type string `json:"type,omitempty"`
ColumnName string `json:"ColumnName"`
}
func NewJsonApiRelation ¶
func NewJsonApiRelation(name string, relationName string, relationType string, columnType string) JsonApiRelation
type ManualResponse ¶
type ManualResponse struct {
Data interface{}
}
Click to show internal directories.
Click to hide internal directories.