config

package
v0.9.12 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 13 Imported by: 3

Documentation

Index

Constants

View Source
const (
	HomeDirectory    = "HomeDirectory"
	WorkingDirectory = "WorkingDirectory"
	ProgramDirectory = "ProgramDirectory"
)

Variables

View Source
var (
	Version = "v0.9.12"
	Srv     *http.Server
	Status  = entity.ConfigStatus{}
	Config  = entity.ComigoConfig{
		Port: 1234,
		Host: "DefaultHost",
		Stores: []stores.Store{
			{
				Type: stores.SMB,
				Smb: stores.SMBOption{
					Host:      os.Getenv("SMB_HOST"),
					Port:      445,
					Username:  os.Getenv("SMB_USER"),
					Password:  os.Getenv("SMB_PASS"),
					ShareName: os.Getenv("SMB_PATH"),
				},
			},
		},
		SupportFileType:       []string{".zip", ".tar", ".rar", ".cbr", ".cbz", ".epub", ".tar.gz", ".tgz", ".tar.bz2", ".tbz2", ".tar.xz", ".txz", ".tar.lz4", ".tlz4", ".tar.sz", ".tsz", ".bz2", ".gz", ".lz4", ".sz", ".xz", ".mp4", ".webm", ".pdf", ".m4v", ".flv", ".avi", ".mp3", ".wav", ".wma", ".ogg"},
		SupportMediaType:      []string{".jpg", ".jpeg", ".jpe", ".jpf", ".jfif", ".jfi", ".png", ".gif", ".apng", ".bmp", ".webp", ".ico", ".heic", ".heif", ".avif"},
		SupportTemplateFile:   []string{".html"},
		ExcludePath:           []string{".comigo", ".idea", ".vscode", ".git", "node_modules", "flutter_ui", "$RECYCLE.BIN", "System Volume Information", ".cache"},
		MaxScanDepth:          4,
		MinImageNum:           3,
		ZipFileTextEncoding:   "",
		OpenBrowser:           true,
		UseCache:              true,
		CachePath:             "",
		ClearCacheExit:        true,
		UploadPath:            "",
		EnableUpload:          true,
		EnableDatabase:        false,
		ClearDatabaseWhenExit: true,
		EnableTLS:             false,
		Username:              "comigo",
		Password:              "",
		DisableLAN:            false,
		DefaultMode:           "scroll",
		LogToFile:             false,
		ConfigPath:            "",
	}
)

Functions

func DeleteConfigIn

func DeleteConfigIn(in string) error

func GetQrcodeURL

func GetQrcodeURL() string

func SaveConfig

func SaveConfig(to string) error

func SetTempDir

func SetTempDir()

SetTempDir 设置临时文件夹,退出时会被清理

func UpdateLocalConfig

func UpdateLocalConfig() error

UpdateLocalConfig 如果存在本地配置,更新本地配置

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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