base

package
v0.0.0-...-46db650 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Config 配置内容
	Config = &AtcConfig{}

	// RefCache 引用模块内存
	RefCache = map[string]*string{}

	// RefCacheMutex 引用模块内存锁
	RefCacheMutex sync.Mutex
)

Functions

func ConfigPath

func ConfigPath()

ConfigPath 配置文件路径

func ReadConfig

func ReadConfig() error

ReadConfig 读取配置

func ReadPageCache

func ReadPageCache(name, query string) ([]byte, bool, bool)

ReadPageCache 读取缓存

func WritePageCache

func WritePageCache(name, query string, cache []byte)

WritePageCache 写入缓存

Types

type AtcConfig

type AtcConfig struct {
	WebPath      string
	Port         string
	RedisAddress string
	RedisAuth    string
	Envs         map[string]string
	IsDev        bool
	Page404      string
	Caches       map[string]int64
}

AtcConfig AtcConfig

type AtcPageCache

type AtcPageCache struct {
	Body        []byte
	ExpiredTime time.Time
}

AtcPageCache 内存缓存

type AtcStatic

type AtcStatic struct {
	// Dir is the directory to serve static files from
	Dir http.FileSystem
	// Prefix is the optional prefix used to serve the static directory content
	Prefix string
	// IndexFile defines which file to serve as index if it exists.
	IndexFile string
}

AtcStatic Static

Jump to

Keyboard shortcuts

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