MCPcopy
hub / github.com/writefreely/writefreely / New

Function New

config/config.go:202–221  ·  view source on GitHub ↗

New creates a new Config with sane defaults

()

Source from the content-addressed store, hash-verified

200
201// New creates a new Config with sane defaults
202func New() *Config {
203 c := &Config{
204 Server: ServerCfg{
205 Port: 8080,
206 Bind: "localhost", /* IPV6 support when not using localhost? */
207 },
208 App: AppCfg{
209 Host: "http://localhost:8080",
210 Theme: "write",
211 WebFonts: true,
212 SingleUser: true,
213 MinUsernameLen: 3,
214 MaxBlogs: 1,
215 Federation: true,
216 PublicStats: true,
217 },
218 }
219 c.UseMySQL(true)
220 return c
221}
222
223// UseMySQL resets the Config's Database to use default values for a MySQL setup.
224func (cfg *Config) UseMySQL(fresh bool) {

Callers 3

ConfigMethod · 0.92
CreateConfigFunction · 0.92
ConfigureFunction · 0.70

Calls 1

UseMySQLMethod · 0.95

Tested by 1

ConfigMethod · 0.74