Documentation ¶
Index ¶
- Constants
- Variables
- func CreateItemValues(db *gorm.DB, item *Item) error
- func DeleteItemValues(db *gorm.DB, item *Item) error
- func FindFieldRelationships(db *gorm.DB, item *Field) error
- func FindItemRelationships(db *gorm.DB, item *Item) error
- func FindItemTypeRelationships(db *gorm.DB, item *ItemType) error
- func Models() []interface{}
- func ValidateCustomPattern(field *Field, v string) error
- func ValidateEnumValues(field *Field, v string) error
- func ValidateLength(field *Field, v string) error
- func ValidatePredefinedPattern(field *Field, v string) error
- func ValidateString(db *gorm.DB, item *Item, field *Field, v string) error
- func ValidateUniqueString(db *gorm.DB, field *Field, v string) error
- type Account
- type AccountDS
- type AccountSQL
- type Field
- type FieldDS
- type FieldSQL
- func (s *FieldSQL) Create(item *Field) error
- func (s *FieldSQL) Delete(item *Field) error
- func (s *FieldSQL) Get(item *Field) error
- func (s *FieldSQL) GetList(itemTypeID uint, projectID uint) ([]Field, error)
- func (s *FieldSQL) GetListForProject(projectID uint, filter FilterOptions) ([]Field, error)
- func (s *FieldSQL) Update(item *Field) error
- type FilterOptions
- type Item
- type ItemDS
- type ItemFilterOptions
- type ItemSQL
- type ItemType
- type ItemTypeDS
- type ItemTypeSQL
- func (s *ItemTypeSQL) Create(item *ItemType) error
- func (s *ItemTypeSQL) Delete(item *ItemType) error
- func (s *ItemTypeSQL) Duplicate(item *ItemType) error
- func (s *ItemTypeSQL) Get(item *ItemType) error
- func (s *ItemTypeSQL) GetList(projectID uint) ([]ItemType, error)
- func (s *ItemTypeSQL) Update(item *ItemType) error
- type Project
- type ProjectDS
- type ProjectSQL
- type Role
- type RoleDS
- type RoleSQL
- type String
- type User
- type UserDS
- type UserSQL
- type Validator
Constants ¶
View Source
const (
AccountTableName = "accounts"
)
View Source
const (
FieldTableName = "fields"
)
View Source
const (
ItemTableName = "items"
)
View Source
const (
ItemTypeTableName = "item_types"
)
View Source
const (
ProjectTableName = "projects"
)
View Source
const (
RoleTableName = "roles"
)
View Source
const (
StringTableName = "strings"
)
View Source
const (
UserTableName = "users"
)
Variables ¶
View Source
var ( DefaultAdminRole = Role{ Name: "Admin", CanEditProject: true, CanEditSchema: true, CanManageUsers: true, CanManageAccessTokens: true, CanPublishContent: true, } DefaultEditorRole = Role{ Name: "Editor", CanEditProject: false, CanEditSchema: false, CanManageUsers: false, CanManageAccessTokens: false, CanPublishContent: true, } )
View Source
var (
ReservedKeys = []string{"updatedAt", "isValid"}
)
Functions ¶
func Models ¶
func Models() []interface{}
Models returns one of every model the database must create
func ValidateCustomPattern ¶
func ValidateEnumValues ¶
func ValidateLength ¶
Types ¶
type Account ¶
type AccountDS ¶
func AccountStore ¶
type AccountSQL ¶
type AccountSQL struct {
// contains filtered or unexported fields
}
func (*AccountSQL) Authenticate ¶
func (s *AccountSQL) Authenticate(acc *Account) error
func (*AccountSQL) Create ¶
func (s *AccountSQL) Create(acc *Account) error
type Field ¶
type Field struct { gorm.Model ItemTypeID uint ProjectID uint Label string `gorm:"primary_key"` ApiKey string `gorm:"primary_key"` FieldType string Localized bool Hint string AppearanceType string Position int32 Required bool Unique bool LengthMin *int32 LengthMax *int32 LengthEq *int32 FormatCustomPattern *string FormatPredefinedPattern *string EnumValues pq.StringArray `gorm:"type:text[]"` ItemType ItemType }
type FieldDS ¶
type FieldDS interface { Create(*Field) error Update(*Field) error GetList(itemTypeID uint, projectID uint) ([]Field, error) GetListForProject(projectID uint, filter FilterOptions) ([]Field, error) Get(*Field) error Delete(*Field) error }
func FieldStore ¶
type FieldSQL ¶
type FieldSQL struct {
// contains filtered or unexported fields
}
func (*FieldSQL) GetListForProject ¶
func (s *FieldSQL) GetListForProject(projectID uint, filter FilterOptions) ([]Field, error)
type FilterOptions ¶
type Item ¶
type ItemDS ¶
type ItemFilterOptions ¶
type ItemSQL ¶
type ItemSQL struct {
// contains filtered or unexported fields
}
type ItemType ¶
type ItemTypeDS ¶
type ItemTypeDS interface { Create(*ItemType) error Update(*ItemType) error GetList(uint) ([]ItemType, error) Get(*ItemType) error Duplicate(*ItemType) error Delete(*ItemType) error }
func ItemTypeStore ¶
func ItemTypeStore(db *gorm.DB) ItemTypeDS
type ItemTypeSQL ¶
type ItemTypeSQL struct {
// contains filtered or unexported fields
}
func (*ItemTypeSQL) Create ¶
func (s *ItemTypeSQL) Create(item *ItemType) error
func (*ItemTypeSQL) Delete ¶
func (s *ItemTypeSQL) Delete(item *ItemType) error
func (*ItemTypeSQL) Duplicate ¶
func (s *ItemTypeSQL) Duplicate(item *ItemType) error
func (*ItemTypeSQL) Get ¶
func (s *ItemTypeSQL) Get(item *ItemType) error
func (*ItemTypeSQL) Update ¶
func (s *ItemTypeSQL) Update(item *ItemType) error
type ProjectDS ¶
type ProjectDS interface { Create(*Project) error Update(*Project) error Get(*Project) error GetList() ([]Project, error) Delete(*Project) error }
func ProjectStore ¶
type ProjectSQL ¶
type ProjectSQL struct {
// contains filtered or unexported fields
}
func (*ProjectSQL) Create ¶
func (s *ProjectSQL) Create(project *Project) error
func (*ProjectSQL) Delete ¶
func (s *ProjectSQL) Delete(project *Project) error
func (*ProjectSQL) Get ¶
func (s *ProjectSQL) Get(project *Project) error
func (*ProjectSQL) GetList ¶
func (s *ProjectSQL) GetList() ([]Project, error)
func (*ProjectSQL) Update ¶
func (s *ProjectSQL) Update(project *Project) error
type Role ¶
type RoleDS ¶
type User ¶
type UserDS ¶
Source Files ¶
- account.go
- account_sql.go
- account_store.go
- field.go
- field_sql.go
- field_store.go
- filter.go
- item.go
- item_sql.go
- item_store.go
- item_type.go
- item_type_sql.go
- item_type_store.go
- models.go
- project.go
- project_sql.go
- project_store.go
- role.go
- role_sql.go
- role_store.go
- string.go
- user.go
- user_sql.go
- user_store.go
- validator.go
- validators.go
Click to show internal directories.
Click to hide internal directories.