Documentation ¶
Index ¶
- func GetIDAsString(idToConvert interface{}) string
- func ParseFilter(filter string) *wst.Filter
- type ACL
- type ArgHttp
- type BearerRole
- type BearerToken
- type BearerUser
- type CacheConfig
- type CasbinConfig
- type Config
- type DataSourceConfig
- type EphemeralData
- type EventContext
- type Instance
- func (modelInstance *Instance) Get(relationName string) interface{}
- func (modelInstance *Instance) GetA(path string) *wst.A
- func (modelInstance *Instance) GetBoolean(path string, defaultValue bool) bool
- func (modelInstance *Instance) GetFloat64(path string) float64
- func (modelInstance *Instance) GetInt(path string) int64
- func (modelInstance *Instance) GetM(path string) *wst.M
- func (modelInstance *Instance) GetMany(relationName string) []Instance
- func (modelInstance *Instance) GetObjectId(path string) (result primitive.ObjectID)
- func (modelInstance *Instance) GetOne(relationName string) *Instance
- func (modelInstance *Instance) GetString(path string) string
- func (modelInstance *Instance) HideProperties()
- func (modelInstance *Instance) Reload(eventContext *EventContext) error
- func (modelInstance *Instance) ToJSON() wst.M
- func (modelInstance *Instance) Transform(out interface{}) error
- func (modelInstance *Instance) UncheckedTransform(out interface{}) interface{}
- func (modelInstance *Instance) UpdateAttributes(data interface{}, baseContext *EventContext) (*Instance, error)
- type InstanceA
- type Model
- func (loadedModel *Model) Build(data wst.M, baseContext *EventContext) Instance
- func (loadedModel *Model) Create(data interface{}, baseContext *EventContext) (*Instance, error)
- func (loadedModel *Model) DeleteById(id interface{}) (int64, error)
- func (loadedModel *Model) EnforceEx(token *BearerToken, objId string, action string, eventContext *EventContext) (error, bool)
- func (loadedModel *Model) ExtractLookupsFromFilter(filterMap *wst.Filter, disableTypeConversions bool) *wst.A
- func (loadedModel *Model) FindById(id interface{}, filterMap *wst.Filter, baseContext *EventContext) (*Instance, error)
- func (loadedModel *Model) FindMany(filterMap *wst.Filter, baseContext *EventContext) (InstanceA, error)
- func (loadedModel *Model) FindOne(filterMap *wst.Filter, baseContext *EventContext) (*Instance, error)
- func (loadedModel *Model) GetHandler(event string) func(eventContext *EventContext) error
- func (loadedModel *Model) GetModelRegistry() *map[string]*Model
- func (loadedModel *Model) HandleRemoteMethod(name string, eventContext *EventContext) error
- func (loadedModel *Model) Initialize()
- func (loadedModel *Model) Observe(operation string, handler func(eventContext *EventContext) error)
- func (loadedModel *Model) On(event string, handler func(eventContext *EventContext) error)
- func (loadedModel *Model) RemoteMethod(handler func(context *EventContext) error, options RemoteMethodOptions) fiber.Router
- func (loadedModel *Model) SendError(ctx *fiber.Ctx, err error) error
- type MongoConfig
- type OperationItem
- type Property
- type RegistryEntry
- type Relation
- type RemoteMethodOptions
- type RemoteMethodOptionsHttp
- type RemoteMethodOptionsHttpArg
- type RemoteMethodOptionsHttpArgs
- type SimplifiedConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetIDAsString ¶ added in v1.2.44
func GetIDAsString(idToConvert interface{}) string
func ParseFilter ¶ added in v1.2.39
Types ¶
type BearerRole ¶ added in v1.2.44
type BearerRole struct {
Name string
}
type BearerToken ¶ added in v1.2.44
type BearerToken struct { User *BearerUser Roles []BearerRole Raw string Claims jwt.MapClaims }
type BearerUser ¶ added in v1.2.44
type BearerUser struct { Id interface{} Data interface{} System bool }
type CacheConfig ¶ added in v1.2.94
type CasbinConfig ¶ added in v1.2.44
type CasbinConfig struct { RequestDefinition string `json:"requestDefinition"` PolicyDefinition string `json:"policyDefinition"` RoleDefinition string `json:"roleDefinition"` PolicyEffect string `json:"policyEffect"` MatchersDefinition string `json:"matchersDefinition"` Policies []string `json:"policies"` }
type Config ¶
type Config struct { Name string `json:"name"` Plural string `json:"plural"` Base string `json:"base"` Public bool `json:"public"` Properties map[string]Property `json:"properties"` Relations *map[string]*Relation `json:"relations"` Hidden []string `json:"hidden"` Casbin CasbinConfig `json:"casbin"` Cache CacheConfig `json:"cache"` Mongo MongoConfig `json:"mongo"` }
type DataSourceConfig ¶
type EphemeralData ¶ added in v1.2.50
type EventContext ¶
type EventContext struct { Bearer *BearerToken BaseContext *EventContext Remote *RemoteMethodOptions Filter *wst.Filter Data *wst.M Query *wst.M Instance *Instance Ctx *fiber.Ctx Ephemeral *EphemeralData IsNewInstance bool Result interface{} ModelID interface{} StatusCode int DisableTypeConversions bool SkipFieldProtection bool }
func (*EventContext) GetBearer ¶ added in v1.2.44
func (eventContext *EventContext) GetBearer(loadedModel *Model) (error, *BearerToken)
func (*EventContext) UpdateEphemeral ¶ added in v1.2.50
func (eventContext *EventContext) UpdateEphemeral(newData *wst.M)
type Instance ¶ added in v1.2.71
type Instance struct { Model *Model Id interface{} // contains filtered or unexported fields }
func (*Instance) GetBoolean ¶ added in v1.3.7
func (*Instance) GetFloat64 ¶ added in v1.2.94
func (*Instance) GetObjectId ¶ added in v1.2.97
func (*Instance) HideProperties ¶ added in v1.2.71
func (modelInstance *Instance) HideProperties()
func (*Instance) Reload ¶ added in v1.2.71
func (modelInstance *Instance) Reload(eventContext *EventContext) error
func (*Instance) UncheckedTransform ¶ added in v1.2.71
func (modelInstance *Instance) UncheckedTransform(out interface{}) interface{}
func (*Instance) UpdateAttributes ¶ added in v1.2.71
func (modelInstance *Instance) UpdateAttributes(data interface{}, baseContext *EventContext) (*Instance, error)
type Model ¶
type Model struct { Name string `json:"name"` CollectionName string `json:"-"` Config *Config `json:"-"` Datasource *datasource.Datasource `json:"-"` Router *fiber.Router `json:"-"` App *wst.IApp `json:"-"` BaseUrl string `json:"-"` CasbinModel *casbinmodel.Model CasbinAdapter **fileadapter.Adapter Enforcer *casbin.Enforcer DisabledHandlers map[string]bool // contains filtered or unexported fields }
func (*Model) Build ¶
func (loadedModel *Model) Build(data wst.M, baseContext *EventContext) Instance
func (*Model) Create ¶
func (loadedModel *Model) Create(data interface{}, baseContext *EventContext) (*Instance, error)
func (*Model) DeleteById ¶
func (*Model) EnforceEx ¶ added in v1.2.73
func (loadedModel *Model) EnforceEx(token *BearerToken, objId string, action string, eventContext *EventContext) (error, bool)
func (*Model) ExtractLookupsFromFilter ¶ added in v1.2.18
func (*Model) GetHandler ¶
func (loadedModel *Model) GetHandler(event string) func(eventContext *EventContext) error
func (*Model) GetModelRegistry ¶ added in v1.2.73
func (*Model) HandleRemoteMethod ¶ added in v1.2.44
func (loadedModel *Model) HandleRemoteMethod(name string, eventContext *EventContext) error
func (*Model) Initialize ¶ added in v1.2.94
func (loadedModel *Model) Initialize()
func (*Model) Observe ¶
func (loadedModel *Model) Observe(operation string, handler func(eventContext *EventContext) error)
func (*Model) On ¶
func (loadedModel *Model) On(event string, handler func(eventContext *EventContext) error)
func (*Model) RemoteMethod ¶
func (loadedModel *Model) RemoteMethod(handler func(context *EventContext) error, options RemoteMethodOptions) fiber.Router
type MongoConfig ¶ added in v1.3.10
type MongoConfig struct { //Database string `json:"database"` Collection string `json:"collection"` }
type OperationItem ¶ added in v1.2.44
type OperationItem struct { Handler func(context *EventContext) error Options RemoteMethodOptions }
type Property ¶
type Property struct { Type interface{} `json:"type"` Required bool `json:"required"` Default interface{} `json:"default"` }
type RegistryEntry ¶
type RemoteMethodOptions ¶
type RemoteMethodOptions struct { Name string Description string Accepts RemoteMethodOptionsHttpArgs Http RemoteMethodOptionsHttp }
type RemoteMethodOptionsHttp ¶
type RemoteMethodOptionsHttpArg ¶ added in v1.2.97
type RemoteMethodOptionsHttpArgs ¶ added in v1.2.97
type RemoteMethodOptionsHttpArgs []RemoteMethodOptionsHttpArg
type SimplifiedConfig ¶ added in v1.2.79
type SimplifiedConfig struct {
Datasource string `json:"dataSource"`
}
Click to show internal directories.
Click to hide internal directories.