Documentation ¶
Overview ¶
This package contains functions shared by the programs of this project. Some of these functions is expected to run on the same machine as a flaarum server.
Index ¶
- Constants
- Variables
- func CleanWord(word string) string
- func DoesPathExists(p string) bool
- func DoesTableExists(projName, tableName string) bool
- func FindIn(container []string, elem string) int
- func G(objectName string) string
- func GetConfigPath() (string, error)
- func GetCtlConfigPath() (string, error)
- func GetDataPath() (string, error)
- func GetFlaarumPath(fileName string) (string, error)
- func GetKeyStrPath() string
- func GetSetting(settingName string) string
- func IsNotIndexedFieldVersioned(projName, tableName, fieldName, version string) bool
- func MakeIndex(projName, tableName, fieldName, newData, rowId string) error
- func MakeSafeIndexName(v string) string
- func NameValidate(name string) error
- func UntestedRandomString(length int) string
- type FKeyStruct
- type FTSStmtStruct
- type FieldStruct
- type StmtStruct
- type TableStruct
- type WhereStruct
Constants ¶
View Source
const ( DATE_FORMAT = "2006-01-02" DATETIME_FORMAT = "2006-01-02T15:04 MST" STRING_MAX_LENGTH = 100 TEXT_INTR_DELIM = "~~~" BACKUP_EXT = "flaa1" PORT = 22318 )
Variables ¶
View Source
var ALLOWED_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789"
View Source
var RootConfigTemplate = `` /* 858-byte string literal not displayed */
Functions ¶
func DoesPathExists ¶ added in v1.3.0
func DoesTableExists ¶
func GetConfigPath ¶
func GetCtlConfigPath ¶ added in v1.5.5
func GetDataPath ¶
func GetFlaarumPath ¶ added in v1.4.1
func GetKeyStrPath ¶
func GetKeyStrPath() string
func GetSetting ¶
func IsNotIndexedFieldVersioned ¶ added in v1.7.0
func MakeSafeIndexName ¶
func NameValidate ¶ added in v1.3.0
func UntestedRandomString ¶
Types ¶
type FKeyStruct ¶
type FTSStmtStruct ¶ added in v1.3.0
Full text search statement
func ParseFTSStmt ¶ added in v1.3.0
func ParseFTSStmt(stmt string) FTSStmtStruct
type FieldStruct ¶
type StmtStruct ¶
type StmtStruct struct { TableName string Fields []string Expand bool Distinct bool StartIndex int64 Limit int64 OrderBy string OrderDirection string // one of 'asc' or 'desc' WhereOptions []WhereStruct }
func ParseSearchStmt ¶
func ParseSearchStmt(stmt string) (StmtStruct, error)
type TableStruct ¶
type TableStruct struct { TableName string TableType string // one or "proper" or "logs" Fields []FieldStruct ForeignKeys []FKeyStruct UniqueGroups [][]string }
func GetTableStructureParsed ¶ added in v1.4.2
func GetTableStructureParsed(projName, tableName string, versionNum int) (TableStruct, error)
func ParseTableStructureStmt ¶
func ParseTableStructureStmt(stmt string) (TableStruct, error)
Click to show internal directories.
Click to hide internal directories.