Help us shape the future of Go! Take the 2026 Go Developer Survey

workdir

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package workdir 负责运行时工作目录的初始化。

目录结构固定为 ./data/{themes,plugins,uploads,cache,logs,backups}。

Index

Constants

View Source
const (
	ThemesDirName  = "themes"
	PluginsDirName = "plugins"
	UploadsDirName = "uploads"
	CacheDirName   = "cache"
	LogsDirName    = "logs"
	BackupsDirName = "backups"
)

工作目录下各子目录的名称。模块引用这些常量而不是自己写字面量, 避免「themes」这种名字散落在多处、改一处漏一处。

Variables

Subdirs 是工作目录下必须存在的子目录。

Functions

func Init

func Init(root string, logger *slog.Logger) (string, error)

Init 幂等地创建工作目录及其子目录,返回其绝对路径。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL