// New creates a version
500112
func New(app string, major, minor int16, build int64) Version {
	return versionImpl{
		app:   app,
		major: major,
		minor: minor,
		build: build,
	}
}
106308
func New(cfg *Config) (*Server, error) {
	s := &Server{
		cfg: cfg,
	}
	for _, addr := range cfg.Addrs {
		srv, err := s.newServer(addr.Proto, addr.Addr)
		if err != nil {
			return nil, err
		}
		glog.V(3).Infof("Server created for HTTP on %s (%s)", addr.Proto, addr.Addr)
		s.servers = append(s.servers, srv...)
	}
	return s, nil
}
565969
func New(appStateUpdater env.AppStateUpdater, config libkbfs.Config) (
	s *Server, err error) {
	logger := config.MakeLogger("HTTP")
	s = &Server{
		appStateUpdater: appStateUpdater,
		config:          config,
		logger:          logger,
	}
	if s.tokens, err = lru.New(tokenCacheSize); err != nil {
		return nil, err
	}
	if s.fs, err = lru.New(fsCacheSize); err != nil {
		return nil, err
	}
	if err = s.restart(); err != nil {
		return nil, err
	}
	ctx, cancel := context.WithCancel(context.Background())
	go s.monitorAppState(ctx)
	s.cancel = cancel
	libmime.Patch(additionalMimeTypes)
	return s, nil
}
467341
func New(ctx context.Context, cfg *config.Config, sv semver.Version) (*Action, error) {
	return newAction(ctx, cfg, sv)
}
1185317
func New(uri string, options map[string]string) (Source, error) {
	u, err := url.Parse(uri)
	if err != nil {
		return nil, err
	}
	switch u.Scheme {
	case "github":
		return NewGitSource(uri, options)
	}
	return nil, ErrUnsupported
}
1175107
func (l *Logger) New(ctx *gear.Context) (interface{}, error) {
	log := Log{}
	l.init(log, ctx)
	return log, nil
}
354109
func New(name, version string) *Kite {
	return NewWithConfig(name, version, config.New())
}
40461
func New(exec utilexec.Interface, dbus utildbus.Interface, protocol Protocol) Interface {
	vstring, err := getIptablesVersionString(exec)
	if err != nil {
		glog.Warningf("Error checking iptables version, assuming version at least %s: %v", MinCheckVersion, err)
		vstring = MinCheckVersion
	}
	runner := &runner{
		exec:     exec,
		dbus:     dbus,
		protocol: protocol,
		hasCheck: getIptablesHasCheckCommand(vstring),
		waitFlag: getIptablesWaitFlag(vstring),
	}
	runner.connectToFirewallD()
	return runner
}
859878
func New(minShift, depth int) *Index {
	if minShift == 0 {
		minShift = DefaultShift
	}
	if depth == 0 {
		depth = DefaultDepth
	}
	return &Index{Version: 0x2, minShift: uint32(minShift), depth: uint32(depth)}
}
528535
func New(msg string, a ...interface{}) Error {
	msg = fmt.Sprintf(msg, a...)
	return Error{
		error: errors.New(msg),
	}
}
69858
func NewVersion(versionNum string) *Version {
	return &Version{
		Version:     versionNum,
		History:     []*ChangeLine{},
		Subsections: []*Subsection{},
	}
}
663189
func New(logger log.Logger, helmClient *k8shelm.Client) *Release {
	r := &Release{
		logger:     logger,
		HelmClient: helmClient,
	}
	return r
}
426371
func New(t T) *I {
	return &I{t, t.FailNow, os.Stdout, !noColorFlag}
}
291727
func New(robot *hal.Robot) (hal.Store, error) {
	c := &config{}
	env.MustProcess(c)
	s := &store{
		config: c,
	}
	s.SetRobot(robot)
	return s, nil
}
746542
func New(execer exec.Interface, bridge string, minVersion string) (Interface, error) {
	if _, err := execer.LookPath(OVS_OFCTL); err != nil {
		return nil, fmt.Errorf("OVS is not installed")
	}
	if _, err := execer.LookPath(OVS_VSCTL); err != nil {
		return nil, fmt.Errorf("OVS is not installed")
	}

	ovsif := &ovsExec{execer: execer, bridge: bridge}

	if minVersion != "" {
		minVer := utilversion.MustParseGeneric(minVersion)

		out, err := ovsif.exec(OVS_VSCTL, "--version")
		if err != nil {
			return nil, fmt.Errorf("could not check OVS version is %s or higher", minVersion)
		}
		// First output line should end with version
		lines := strings.Split(out, "\n")
		spc := strings.LastIndex(lines[0], " ")
		instVer, err := utilversion.ParseGeneric(lines[0][spc+1:])
		if err != nil {
			return nil, fmt.Errorf("could not find OVS version in %q", lines[0])
		}
		if !instVer.AtLeast(minVer) {
			return nil, fmt.Errorf("found OVS %v, need %s or later", instVer, minVersion)
		}
	}

	return ovsif, nil
}
975915
func New(version, desc string, fn func(Command), paramNames ...string) *CLI {
	nameParts := strings.Split(os.Args[0], "/")
	cli := new(CLI)
	cli.init(nameParts[len(nameParts)-1], desc, fn, paramNames...)
	cli.version = version
	cli.description = desc
	return cli
}
138560
func New(dir string) (Git, error) {
	if err := os.MkdirAll(dir, 0755); err != nil {
		return Git{}, err
	}
	return Git{dir: dir}, nil
}