Documentation
¶
Index ¶
- func AddColumnIfNotExist(db *sqlx.DB, tableName, columnName, columnType, defaultValue string, ...) error
- func BuildAssetPath(rootFolder, collectionPath, assetName, extension string) (string, error)
- func BuildCollectionPath(rootFolder, collectionPath string) (string, error)
- func BytesToHumanReadable(bytes int) string
- func CheckHashPassword(storedPassword string, password string) (bool, error)
- func Contains(slice []string, item string) bool
- func CopyFile(src, dst string) error
- func CreateSchema(db *sqlx.DB, schema string) error
- func CreateSchemaTx(tx *sqlx.Tx, schema string) error
- func DeleteColumn(db *sqlx.DB, tableName, columnName string) error
- func DeleteColumnIfExists(db *sqlx.DB, tableName, columnName string) error
- func DirExists(dir string) bool
- func EpochToRFC3339(epoch int64) string
- func ExpandPath(path string) (string, error)
- func FileExists(filePath string) bool
- func FormatDateTime(t time.Time, timezone *time.Location, locale language.Tag) string
- func GenerateToken() string
- func GenerateXXHashChecksum(filePath string) (string, error)
- func GetCollectionPaths(collectionPath string) []string
- func GetCurrentTime() string
- func GetEnv(key, fallback string) string
- func GetEpochTime() int64
- func GetIsClosed(tx *sqlx.Tx) (bool, error)
- func GetLastSyncTime(tx *sqlx.Tx) (int64, error)
- func GetMD5Hash(text string) string
- func GetParent(p string) string
- func GetProjectFile(tx *sqlx.Tx) (string, error)
- func GetProjectFolder(tx *sqlx.Tx) (string, error)
- func GetProjectIcon(tx *sqlx.Tx) (string, error)
- func GetProjectId(tx *sqlx.Tx) (string, error)
- func GetProjectName(tx *sqlx.Tx) (string, error)
- func GetProjectSyncToken(tx *sqlx.Tx) (string, error)
- func GetProjectVersion(tx *sqlx.Tx) (float64, error)
- func GetProjectWorkingDir(tx *sqlx.Tx) (string, error)
- func GetRemoteUrl(tx *sqlx.Tx) (string, error)
- func GetStudioName(tx *sqlx.Tx) (string, error)
- func GetWriteThroughEnabled(tx *sqlx.Tx) (bool, error)
- func HashPassword(password string) (string, error)
- func IsColumnExist(db *sqlx.DB, tableName, columnName string) (bool, error)
- func IsProjectDirty(tx *sqlx.Tx) (bool, error)
- func IsValidPointer(pointer string) bool
- func IsValidURL(link string) bool
- func LaunchFile(filePath string) error
- func MatchesRegex(path string, pattern string) (bool, error)
- func NonCaseSensitiveContains(slice []string, item string) bool
- func NormalizePath(path string) string
- func OpenDb(dbPath string) (*sqlx.DB, error)
- func RFC3339ToEpoch(rfc3339 string) (int64, error)
- func RemoveDuplicates(slice []string) []string
- func RenameColumn(db *sqlx.DB, tableName, oldColumnName, newColumnName string) error
- func RenameTable(db *sqlx.DB, oldName, newName string) error
- func ResizeImage(fileBytes []byte, width, height uint) ([]byte, error)
- func RevealInExplorer(filePath string)
- func SetIsClosed(tx *sqlx.Tx, isClosed bool) error
- func SetLastSyncTime(tx *sqlx.Tx, lastSyncTime int64) error
- func SetProjectDirty(tx *sqlx.Tx, isDirty bool) error
- func SetProjectIcon(tx *sqlx.Tx, projectIcon string) error
- func SetProjectIgnoreList(tx *sqlx.Tx, ignoreList []string) error
- func SetProjectSyncToken(tx *sqlx.Tx, syncToken string) error
- func SetProjectVersion(tx *sqlx.Tx, version float64) error
- func SetProjectWorkingDir(tx *sqlx.Tx, workingDir string) error
- func SetRemoteUrl(tx *sqlx.Tx, remoteUrl string) error
- func SetRowsSynced(tx *sqlx.Tx, table string, ids []string) error
- func SetStudioName(tx *sqlx.Tx, studioName string) error
- func SetTableToSynced(tx *sqlx.Tx, table string) error
- func SetTablesToSynced(tx *sqlx.Tx, tables []string) error
- func SetWriteThroughEnabled(tx *sqlx.Tx, enabled bool) error
- func Slugify(text, separator string, lowercase bool) string
- func SplitStatements(content string) []string
- func StructToMap(data interface{}, snake_case bool) map[string]interface{}
- func TableExists(db *sqlx.DB, tableName string) (bool, error)
- func ToSnakeCase(text string) string
- func ValidateEmail(email string) bool
- func ValidatePassword(password string) (bool, string)
- type ColumnInfo
- type ProjectContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddColumnIfNotExist ¶
func BuildAssetPath ¶
func BuildCollectionPath ¶
func BytesToHumanReadable ¶
func CheckHashPassword ¶
func CopyFile ¶
CopyFile copies a file from src to dst. If dst already exists, it will be overwritten.
func DeleteColumnIfExists ¶
func EpochToRFC3339 ¶
func ExpandPath ¶
func FileExists ¶
func FormatDateTime ¶
func GenerateToken ¶
func GenerateToken() string
func GenerateXXHashChecksum ¶
func GetCollectionPaths ¶
func GetCurrentTime ¶
func GetCurrentTime() string
func GetEpochTime ¶
func GetEpochTime() int64
func GetMD5Hash ¶
func GetRemoteUrl ¶
GetRemoteUrl reads the remote project URL from the config table.
func GetWriteThroughEnabled ¶
GetWriteThroughEnabled reads the write_through_enabled config value for a project. Returns false if the key is missing (default off).
func HashPassword ¶
func IsValidPointer ¶
func IsValidURL ¶
IsValidURL checks if the input string is a valid URL
func LaunchFile ¶
func NormalizePath ¶
func RFC3339ToEpoch ¶
func RemoveDuplicates ¶
func RenameColumn ¶
RenameColumn renames a column in the SQLite database.
func ResizeImage ¶
ResizeImage resizes the image bytes to the specified width and height.
func RevealInExplorer ¶
func RevealInExplorer(filePath string)
func SetRemoteUrl ¶
SetRemoteUrl writes the remote project URL to the config table.
func SetRowsSynced ¶
SetRowsSynced marks specific rows as synced in a given table by their IDs. This prevents race conditions where unrelated unsynced rows get marked.
func SetWriteThroughEnabled ¶
SetWriteThroughEnabled writes the write_through_enabled config value for a project.
func SplitStatements ¶
func StructToMap ¶
func ToSnakeCase ¶
func ValidateEmail ¶
func ValidatePassword ¶
Types ¶
type ColumnInfo ¶
type ColumnInfo struct {
Cid int `db:"cid"`
Name string `db:"name"`
Type string `db:"type"`
NotNull int `db:"notnull"`
DfltValue sql.NullString `db:"dflt_value"`
Pk int `db:"pk"`
}
ColumnInfo holds the schema information for a column