Versions in this module Expand all Collapse all v1 v1.0.0 Jul 17, 2018 Changes in this version + const ActionAttach + const ActionCreate + const ActionDelete + const ActionGlob + const ActionRead + const ActionUpdate + const All + const FullText + const Hidden + const Invalid + const None + const Spatial + const Unique + const Visible + var AllActions = []string + var DefaultExtension = "javascript" + func ClearManager() + func FormatParentID(parent string) string + func PolicyValidate(action, path string, auth Authorization, policies []*Policy) (foundPolicy *Policy, foundRole *Role) + func SortActions(schema *Schema) + type Action struct + Description string + ID string + InputSchema map[string]interface{} + Method string + OutputSchema map[string]interface{} + Parameters map[string]interface{} + Path string + func NewAction(id, method, path, description string, ...) Action + func NewActionFromObject(id string, rawData interface{}) (Action, error) + func (action *Action) GetInputParameterNames() ([]string, error) + func (action *Action) GetInputParameterType(parameter string) (string, error) + func (action *Action) GetInputType() (string, error) + func (action *Action) TakesID() bool + func (action *Action) TakesNoArgs() bool + type AttachInfo struct + OtherResourceCondition *ResourceCondition + RelationPropertyName string + SchemaID string + type Authorization interface + AuthToken func() string + Catalog func() []*Catalog + Roles func() []*Role + TenantID func() string + TenantName func() string + func NewAuthorization(tenantID, tenantName, authToken string, roleIDs []string, catalog []*Catalog) Authorization + type BaseAuthorization struct + func (auth *BaseAuthorization) AuthToken() string + func (auth *BaseAuthorization) Catalog() []*Catalog + func (auth *BaseAuthorization) Roles() []*Role + func (auth *BaseAuthorization) TenantID() string + func (auth *BaseAuthorization) TenantName() string + type Catalog struct + Endpoints []*Endpoint + Name string + Type string + func NewCatalog(name, catalogType string, endPoints []*Endpoint) *Catalog + type Endpoint struct + Interface string + Region string + URL string + func NewEndpoint(url, region, iface string) *Endpoint + type EventTimeLimit struct + EventRegex *regexp.Regexp + TimeDuration time.Duration + func NewEventTimeLimit(eventRegex *regexp.Regexp, timeLimit time.Duration) *EventTimeLimit + func (eventTimeLimit *EventTimeLimit) Match(event string) bool + type Extension struct + Code string + CodeType string + File string + ID string + Path *regexp.Regexp + URL string + func NewExtension(raw interface{}) (*Extension, error) + func (e *Extension) Match(path string) bool + type Filter struct + func CreateExcludeAllFilter() *Filter + func (f *Filter) IsForbidden(key string) bool + func (f *Filter) RemoveHiddenKeysFromMap(data map[string]interface{}) map[string]interface{} + func (f *Filter) RemoveHiddenKeysFromSlice(data []string) []string + type FilterFactory struct + func (f *FilterFactory) CreateFilterFromProperties(visible, hidden []string) (*Filter, error) + type Index struct + Columns []string + Name string + Type IndexType + func NewIndex(name string, columns []string, indexType IndexType) Index + func NewIndexFromObj(name string, rawTypeData interface{}) (*Index, error) + type IndexType string + type Link struct + Href string + Rel string + type LockPolicy int + const LockRelatedResources + const NoLocking + const SkipRelatedResources + type Manager struct + Extensions []*Extension + TimeLimit time.Duration + TimeLimits []*PathEventTimeLimit + func GetManager() *Manager + func (manager *Manager) ClearExtensions() + func (manager *Manager) GetAttachmentPolicies(path string, auth Authorization) []*Policy + func (manager *Manager) LoadExtensions(extensions []*Resource) error + func (manager *Manager) LoadNamespaces(namespaces []*Resource) error + func (manager *Manager) LoadPolicies(policies []*Resource) error + func (manager *Manager) LoadResource(schemaID string, dataMap map[string]interface{}) (*Resource, error) + func (manager *Manager) LoadResourceFromJSONString(schemaID string, jsonData string) (*Resource, error) + func (manager *Manager) LoadSchemaFromFile(filePath string) error + func (manager *Manager) LoadSchemasFromFiles(filePaths ...string) error + func (manager *Manager) Namespace(name string) (*Namespace, bool) + func (manager *Manager) Namespaces() map[string]*Namespace + func (manager *Manager) NobodyResourcePaths() []*regexp.Regexp + func (manager *Manager) OrderedLoadSchemasFromFiles(filePaths []string) error + func (manager *Manager) OrderedSchemas() []*Schema + func (manager *Manager) Policies() []*Policy + func (manager *Manager) PolicyValidate(action, path string, auth Authorization) (*Policy, *Role) + func (manager *Manager) Schema(id string) (*Schema, bool) + func (manager *Manager) Schemas() Map + func (manager *Manager) String() string + func (manager *Manager) UnRegisterSchema(schema *Schema) error + func (manager *Manager) ValidateSchema(schemaPath, filePath string) error + type Map map[string]*Schema + type Namespace struct + ID string + Parent string + ParentNamespace *Namespace + Prefix string + func NewNamespace(raw interface{}) (*Namespace, error) + func (namespace *Namespace) GetFullPrefix() string + func (namespace *Namespace) IsTopLevel() bool + func (namespace *Namespace) SetParentNamespace(parent *Namespace) + type NamespaceResource struct + Collection string + Links []Link + Name string + type PathEventTimeLimit struct + EventRegex *regexp.Regexp + PathRegex *regexp.Regexp + TimeDuration time.Duration + func NewPathEventTimeLimit(pathRegex, eventRegex string, timeDuration time.Duration) *PathEventTimeLimit + func (pathEventTimeLimit *PathEventTimeLimit) Match(path string) bool + type Policy struct + Action string + Description string + Effect string + ID string + Principal string + RawData interface{} + func GetAttachmentPolicies(path string, auth Authorization, policies []*Policy) []*Policy + func NewEmptyPolicy() *Policy + func NewPolicy(raw interface{}) (*Policy, error) + func (p *Policy) Check(action string, authorization Authorization, data map[string]interface{}) error + func (p *Policy) FilterSchema(properties map[string]interface{}, propertiesOrder, required []string) (map[string]interface{}, []string, []string) + func (p *Policy) GetCurrentResourceCondition() *ResourceCondition + func (p *Policy) IsDeny() bool + func (p *Policy) RemoveHiddenProperty(data map[string]interface{}) map[string]interface{} + func (policy *Policy) GetOtherResourceCondition() *ResourceCondition + func (policy *Policy) GetPropertyFilter() *Filter + func (policy *Policy) GetRelationPropertyName() string + func (policy *Policy) GetResourcePathRegexp() *regexp.Regexp + type Predicate interface + Validate func(string) bool + type Property struct + Default interface{} + Description string + Format string + ID string + Indexed bool + Nullable bool + OnDeleteCascade bool + Properties map[string]interface{} + Relation string + RelationColumn string + RelationProperty string + SQLType string + Title string + Type string + Unique bool + func NewProperty(id, title, description, typeID, format, relation, relationColumn, ... string, ...) Property + func NewPropertyFromObj(id string, rawTypeData interface{}, required bool) *Property + type PropertyMap map[string]Property + type PropertyOrder struct + func (p PropertyOrder) Len() int + func (p PropertyOrder) Less(i, j int) bool + func (p PropertyOrder) String() string + func (p PropertyOrder) Swap(i, j int) + type Resource struct + func NewResource(schema *Schema, properties map[string]interface{}) (*Resource, error) + func (resource *Resource) Data() map[string]interface{} + func (resource *Resource) Get(key string) interface{} + func (resource *Resource) ID() string + func (resource *Resource) JSONString() (string, error) + func (resource *Resource) ParentID() string + func (resource *Resource) Path() string + func (resource *Resource) PopulateDefaults() error + func (resource *Resource) Schema() *Schema + func (resource *Resource) SetParentID(id string) + func (resource *Resource) String() string + func (resource *Resource) Update(updateData map[string]interface{}) error + func (resource *Resource) Values() []interface{} + type ResourceCondition struct + Condition []interface{} + func NewResourceCondition(rawCondition []interface{}, policyID string) (*ResourceCondition, error) + func (p *ResourceCondition) ApplyPropertyConditionFilter(action string, data map[string]interface{}, ...) error + func (p *ResourceCondition) GetTenantIDFilter(action string, tenantID string) []string + func (p *ResourceCondition) RequireOwner() bool + func (policy *ResourceCondition) AddCustomFilters(filters map[string]interface{}, tenantId string) + type Role struct + Name string + func (r *Role) Match(principal string) bool + type Schema struct + Actions []Action + Description string + Extends []string + ID string + Indexes []Index + IsolationLevel map[string]interface{} + JSONSchema map[string]interface{} + JSONSchemaOnCreate map[string]interface{} + JSONSchemaOnUpdate map[string]interface{} + Metadata map[string]interface{} + Namespace *Namespace + NamespaceID string + OnParentDeleteCascade bool + OrderPropertiesBefore []string + Parent string + ParentSchema *Schema + Plural string + Prefix string + Properties []Property + RawData interface{} + Singular string + Title string + Type string + URL string + URLWithParents string + func GetSchemaByPath(path string) *Schema + func GetSchemaByURLPath(path string) *Schema + func NewSchema(id, plural, title, description, singular string) *Schema + func NewSchemaFromObj(rawTypeData interface{}) (*Schema, error) + func (schema *Schema) Extend(fromSchema *Schema) error + func (schema *Schema) GenerateCustomPath(data map[string]interface{}) (path string, err error) + func (schema *Schema) GetActionFromCommand(command string) *Action + func (schema *Schema) GetActionURL(path string) string + func (schema *Schema) GetActionURLWithParents(path string) string + func (schema *Schema) GetDbTableName() string + func (schema *Schema) GetLockingPolicy(event string) LockPolicy + func (schema *Schema) GetParentURL() string + func (schema *Schema) GetPluralURL() string + func (schema *Schema) GetPluralURLWithParents() string + func (schema *Schema) GetPropertyByID(id string) (*Property, error) + func (schema *Schema) GetResourceIDFromPath(schemaPath string) string + func (schema *Schema) GetSingleURL() string + func (schema *Schema) GetSingleURLWithParents() string + func (schema *Schema) Init() error + func (schema *Schema) IsAbstract() bool + func (schema *Schema) JSON() map[string]interface{} + func (schema *Schema) ParentID() string + func (schema *Schema) ParentSchemaPropertyID() string + func (schema *Schema) SetNamespace(namespace *Namespace) + func (schema *Schema) SetParentSchema(parentSchema *Schema) + func (schema *Schema) SkipConfigPrefix() bool + func (schema *Schema) StateVersioning() bool + func (schema *Schema) SyncKeyTemplate() (syncKeyTemplate string, ok bool) + func (schema *Schema) Titles() []string + func (schema *Schema) Validate(jsonSchema interface{}, object interface{}) error + func (schema *Schema) ValidateOnCreate(object interface{}) error + func (schema *Schema) ValidateOnUpdate(object interface{}) error + type Schemas struct + Schemas []*Schema + type Tags map[string]string + type Version struct + ID string + Links []Link + Status string