// NewMain gets a new Main with the default configuration.
4003
func NewMain() *Main {
	return &Main{
		Bucket:      "pdk-test-bucket",
		Region:      "us-east-1",
		PilosaHosts: []string{"localhost:10101"},
		Index:       "pdk",
		BatchSize:   1000,
		SubjectAt:   "#@!pdksubj",
		SubjectPath: []string{},
		Proxy:       ":13131",
	}
}
1007469
func NewConfig(confName string) (ConfigInterface, error) {
	c := &Config{
		data: make(map[string]map[string]string),
	}
	err := c.parse(confName)
	return c, err
}
382175
func New(root string, options ...func(*LinuxFactory) error) (Factory, error) {
	if root != "" {
		if err := os.MkdirAll(root, 0700); err != nil {
			return nil, newGenericError(err, SystemError)
		}
	}
	l := &LinuxFactory{
		Root:      root,
		InitPath:  "/proc/self/exe",
		InitArgs:  []string{os.Args[0], "init"},
		Validator: validate.New(),
		CriuPath:  "criu",
	}
	Cgroupfs(l)
	for _, opt := range options {
		if opt == nil {
			continue
		}
		if err := opt(l); err != nil {
			return nil, err
		}
	}
	return l, nil
}
906869
func NewConfig(username, password string) (Config, error) {
	alias := os.Getenv("CLC_ALIAS")
	agent := userAgentDefault
	if v := os.Getenv("CLC_USER_AGENT"); v != "" {
		agent = v
	}
	base := baseUriDefault
	if v := os.Getenv("CLC_BASE_URL"); v != "" {
		base = v
	}
	uri, err := url.Parse(base)
	return Config{
		User: User{
			Username: username,
			Password: password,
		},
		Alias:     alias,
		BaseURL:   uri,
		UserAgent: agent,
	}, err
}
154775
func NewConf() *Config {
	return &Config{
		DefaultLevel: "",
		Loggers:      []LoggerConfig{},
		Hooks:        make(map[string]HookConfig),
	}
}
979739
func New(cnf *config.Config, servers []string) iface.Backend {
	return &Backend{
		Backend: common.NewBackend(cnf),
		servers: servers,
	}
}
1086217
func NewConfig(appName, fileName string) *Conf {
	if appName == "" {
		panic("appName.required")
	}

	if fileName == "" {
		fileName = "conf.json"
	}

	c := new(Conf)
	c.dirPath = fmt.Sprintf("%s/.%s", os.Getenv("HOME"), appName)
	c.fileName = fileName

	c.initConfig()

	return c
}
1108449
func New(conf *Config) (*Node, error) {
	// Copy config and resolve the datadir so future changes to the current
	// working directory don't affect the node.
	confCopy := *conf
	conf = &confCopy
	if conf.DataDir != "" {
		absdatadir, err := filepath.Abs(conf.DataDir)
		if err != nil {
			return nil, err
		}
		conf.DataDir = absdatadir
	}
	// Ensure that the instance name doesn't cause weird conflicts with
	// other files in the data directory.
	if strings.ContainsAny(conf.Name, `/\`) {
		return nil, errors.New(`Config.Name must not contain '/' or '\'`)
	}
	if conf.Name == datadirDefaultKeyStore {
		return nil, errors.New(`Config.Name cannot be "` + datadirDefaultKeyStore + `"`)
	}
	if strings.HasSuffix(conf.Name, ".ipc") {
		return nil, errors.New(`Config.Name cannot end in ".ipc"`)
	}
	// Ensure that the AccountManager method works before the node has started.
	// We rely on this in cmd/geth.
	am, ephemeralKeystore, err := makeAccountManager(conf)
	if err != nil {
		return nil, err
	}
	if conf.Logger == nil {
		conf.Logger = log.New()
	}
	// Note: any interaction with Config that would create/touch files
	// in the data directory or instance directory is delayed until Start.
	return &Node{
		accman:            am,
		ephemeralKeystore: ephemeralKeystore,
		config:            conf,
		serviceFuncs:      []ServiceConstructor{},
		ipcEndpoint:       conf.IPCEndpoint(),
		httpEndpoint:      conf.HTTPEndpoint(),
		wsEndpoint:        conf.WSEndpoint(),
		eventmux:          new(event.TypeMux),
		log:               conf.Logger,
	}, nil
}
832778
func NewForConfig(c *unversioned.Config) (*CoreClient, error) {
	config := *c
	if err := setConfigDefaults(&config); err != nil {
		return nil, err
	}
	client, err := unversioned.RESTClientFor(&config)
	if err != nil {
		return nil, err
	}
	return &CoreClient{client}, nil
}
643950
func New(robot *hal.Robot) (hal.Adapter, error) {
	c := &config{}
	env.MustProcess(c)

	a := &adapter{
		user:     c.User,
		password: c.Password,
		resource: c.Resource,
		rooms:    func() []string { return strings.Split(c.Rooms, ",") }(),
	}
	a.SetRobot(robot)
	return a, nil
}
45257
func New(err error) config.Interface {
	if err == nil {
		panic("error cannot be nil")
	}
	return erroringInterface{err}
}
891146
func New(c config.Config, conn sol.Conn) *Auth {
	return create(c, conn, NewUsers(conn))
}
207505
func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget) (*UserServer, error) {
	genericServer, err := c.GenericConfig.New("user.openshift.io-apiserver", delegationTarget)
	if err != nil {
		return nil, err
	}

	s := &UserServer{
		GenericAPIServer: genericServer,
	}

	v1Storage, err := c.V1RESTStorage()
	if err != nil {
		return nil, err
	}

	apiGroupInfo := genericapiserver.NewDefaultAPIGroupInfo(userapiv1.GroupName, c.ExtraConfig.Scheme, metav1.ParameterCodec, c.ExtraConfig.Codecs)
	apiGroupInfo.VersionedResourcesStorageMap[userapiv1.SchemeGroupVersion.Version] = v1Storage
	if err := s.GenericAPIServer.InstallAPIGroup(&apiGroupInfo); err != nil {
		return nil, err
	}

	return s, nil
}
1018852
func NewDefault(primary, defaultValue *Spec) *Spec {
	return DefaultSpec(&Default{
		Primary: primary,
		Default: defaultValue,
	})
}
1071479
func New(initializer Initializer, opts ...options.Opt) *Reference {
	return NewWithData(func(interface{}) (interface{}, error) {
		return initializer()
	}, opts...)
}
979139
func New() *RBAC {
	return &RBAC{
		roles:   make(Roles),
		parents: make(map[string]map[string]struct{}),
	}
}
737334
func New(accessKeyID, secretAccessKey string) (c *Config, err error) {
	c, err = NewDefault()
	if err != nil {
		c = nil
		return
	}
	c.AccessKeyID = accessKeyID
	c.SecretAccessKey = secretAccessKey

	return
}