func (c *Config) WithDefaultLibrarianAddrs() *Config {
	addr, err := parse.Addr(DefaultLibrarianIP, DefaultLibrarianPort)
	errors.MaybePanic(err)  
	c.LibrarianAddrs = []*net.TCPAddr{addr}
	return c
}
WithDefaultLibrarianAddrs sets the librarian addresses to a single address of the default IP
and port.
package author
import (
	"net"
	"os"
	"path/filepath"
	"github.com/drausin/libri/libri/author/io/print"
	"github.com/drausin/libri/libri/author/io/publish"
	"github.com/drausin/libri/libri/common/ecid"
	"github.com/drausin/libri/libri/common/errors"
	"github.com/drausin/libri/libri/common/parse"
	"go.uber.org/zap"
	"go.uber.org/zap/zapcore"
)
const (
	DefaultLibrarianPort = 20100
	DefaultLibrarianIP = "localhost"
	DefaultLogLevel = zap.InfoLevel
	DataSubdir = "author-data"
	DBSubDir = "db"
	KeychainSubDir = "keychain"
)
type Config struct {
	DataDir string
	DbDir string
	KeychainDir string
	OrgID ecid.ID
	LibrarianAddrs []*net.TCPAddr
	Print *print.Parameters
	Publish *publish.Parameters
	LogLevel zapcore.Level
}
func NewDefaultConfig() *Config {
	config := &Config{}
	config.WithDefaultDataDir()
	config.WithDefaultDBDir()
	config.WithDefaultKeychainDir()
	config.WithDefaultLibrarianAddrs()
	config.WithDefaultPrint()
	config.WithDefaultPublish()
	config.WithDefaultLogLevel()
	return config
}
func (c *Config) WithDataDir(dataDir string) *Config {
	if dataDir == "" {
		return c.WithDefaultDataDir()
	}
	c.DataDir = dataDir
	return c
}
func (c *Config) WithDefaultDataDir() *Config {
	cwd, err := os.Getwd()
	errors.MaybePanic(err)
	c.DataDir = filepath.Join(cwd, DataSubdir)
	return c
}
func (c *Config) WithDBDir(dbDir string) *Config {
	if dbDir == "" {
		return c.WithDefaultDBDir()
	}
	c.DbDir = dbDir
	return c
}
func (c *Config) WithDefaultDBDir() *Config {
	c.DbDir = filepath.Join(c.DataDir, DBSubDir)
	return c
}
func (c *Config) WithKeychainDir(keychainDir string) *Config {
	if keychainDir == "" {
		return c.WithDefaultKeychainDir()
	}
	c.KeychainDir = keychainDir
	return c
}
func (c *Config) WithDefaultKeychainDir() *Config {
	c.KeychainDir = filepath.Join(c.DataDir, KeychainSubDir)
	return c
}
func (c *Config) WithLibrarianAddrs(librarianAddrs []*net.TCPAddr) *Config {
	if librarianAddrs == nil {
		return c.WithDefaultLibrarianAddrs()
	}
	c.LibrarianAddrs = librarianAddrs
	return c
}