// Setup the api-aaa middleware
// Also loads the pfconfig resources and registers them in the pool
490770
func setup(c *caddy.Controller) error {
	ctx := log.LoggerNewContext(context.Background())

	apiAAA, err := buildApiAAAHandler(ctx)

	if err != nil {
		return err
	}

	httpserver.GetConfig(c).AddMiddleware(func(next httpserver.Handler) httpserver.Handler {
		apiAAA.Next = next
		return apiAAA
	})

	return nil
}
1241822
func (m *localVolumeMounter) SetUp(fsGroup *int64) error {
	return m.SetUpAt(m.GetPath(), fsGroup)
}
581421
func (s *Server) AddResourcePool(pool pool.ResourcePool, _ *struct{}) error {
	return s.f.AddResourcePool(s.context(), &pool)
}
181519
func setup(c *caddy.Controller) error {
	resource, err := expVarParse(c)
	if err != nil {
		return err
	}

	// publish any extra information/metrics we may want to capture
	publishExtraVars()

	ev := ExpVar{Resource: resource}

	httpserver.GetConfig(c).AddMiddleware(func(next httpserver.Handler) httpserver.Handler {
		ev.Next = next
		return ev
	})

	return nil
}
845876
func (b *glusterfsMounter) SetUp(fsGroup *int64) error {
	return b.SetUpAt(b.GetPath(), fsGroup)
}
482160
func (c *connectionBenchmark) setup() error {
	c.successHistogram.Reset()
	c.uncorrectedSuccessHistogram.Reset()
	c.errorHistogram.Reset()
	c.uncorrectedErrorHistogram.Reset()
	c.successTotal = 0
	c.errorTotal = 0
	return c.requester.Setup()
}
543920
func Setup(app *gramework.App) {
	err := app.UseAfterRequest(serveXHost)
	if err != nil {
		app.Logger.WithError(err).WithField("package", "mw/xhostname").Error("could not register middleware")
	}
}
381482
func setup(c *caddy.Controller) error {
	httpserver.GetConfig(c).AddMiddleware(func(next httpserver.Handler) httpserver.Handler {
		return PoolHandler{Next: next, refreshLauncher: &sync.Once{}}
	})

	return nil
}
1190988
func init() {
	ps := endpoints.ProdService{}

	r := router.New()

	// Setup Cloud Endpoints.
	svr := prpc.Server{
		UnaryServerInterceptor: grpcmon.NewUnaryServerInterceptor(nil),
	}
	servicesPb.RegisterServicesServer(&svr, services.New())
	registrationPb.RegisterRegistrationServer(&svr, registration.New())

	// Standard HTTP endpoints.
	base := standard.Base().Extend(ps.Base)
	svr.InstallHandlers(r, base)
	standard.InstallHandlers(r)

	http.Handle("/", r)
}
521975
func SetupCollectdPaths(r *mux.Router, handler http.Handler, endpoint string) {
	r.Path(endpoint).Methods("POST").Headers("Content-Type", "application/json").Handler(handler)
	r.Path(endpoint).Methods("POST").Headers("Content-Type", "application/json; charset=UTF-8").Handler(handler)
	r.Path(endpoint).Methods("POST").Headers("Content-Type", "").HandlerFunc(web.InvalidContentType)
}
130411
func setup(c *caddy.Controller) error {
	configs, err := mimeParse(c)
	if err != nil {
		return err
	}

	httpserver.GetConfig(c).AddMiddleware(func(next httpserver.Handler) httpserver.Handler {
		return Mime{Next: next, Configs: configs}
	})

	return nil
}
822521
func SetupProtobufV2ByPaths(r *mux.Router, handler http.Handler, path string) {
	r.Path(path).Methods("POST").Headers("Content-Type", "application/x-protobuf").Handler(handler)
}
259173
func RegisterPriorityConfigFactory(name string, pcf PriorityConfigFactory) string {
	schedulerFactoryMutex.Lock()
	defer schedulerFactoryMutex.Unlock()
	validateAlgorithmNameOrDie(name)
	priorityFunctionMap[name] = pcf
	return name
}
551936
func Setup(conf config.Config) error {
	nsConfig := conf.NetworkServer
	schedulerInterval = nsConfig.Scheduler.SchedulerInterval

	if err := data.Setup(conf); err != nil {
		return errors.Wrap(err, "setup downlink/data error")
	}

	if err := join.Setup(conf); err != nil {
		return errors.Wrap(err, "setup downlink/join error")
	}

	if err := multicast.Setup(conf); err != nil {
		return errors.Wrap(err, "setup downlink/multicast error")
	}

	if err := proprietary.Setup(conf); err != nil {
		return errors.Wrap(err, "setup downlink/proprietary error")
	}

	return nil
}
643103
func Setup(ganeshaConfig string, gracePeriod uint) error {
	// Start rpcbind if it is not started yet
	cmd := exec.Command("/usr/sbin/rpcinfo", "127.0.0.1")
	if err := cmd.Run(); err != nil {
		cmd = exec.Command("/usr/sbin/rpcbind", "-w")
		if out, err := cmd.CombinedOutput(); err != nil {
			return fmt.Errorf("Starting rpcbind failed with error: %v, output: %s", err, out)
		}
	}

	cmd = exec.Command("/usr/sbin/rpc.statd")
	if out, err := cmd.CombinedOutput(); err != nil {
		return fmt.Errorf("rpc.statd failed with error: %v, output: %s", err, out)
	}

	// Start dbus, needed for ganesha dynamic exports
	cmd = exec.Command("dbus-daemon", "--system")
	if out, err := cmd.CombinedOutput(); err != nil {
		return fmt.Errorf("dbus-daemon failed with error: %v, output: %s", err, out)
	}

	err := setRlimitNOFILE()
	if err != nil {
		glog.Warningf("Error setting RLIMIT_NOFILE, there may be 'Too many open files' errors later: %v", err)
	}

	// Use defaultGaneshaConfigContents if the ganeshaConfig doesn't exist yet
	if _, err = os.Stat(ganeshaConfig); os.IsNotExist(err) {
		err = ioutil.WriteFile(ganeshaConfig, defaultGaneshaConfigContents, 0600)
		if err != nil {
			return fmt.Errorf("error writing ganesha config %s: %v", ganeshaConfig, err)
		}
	}
	err = setGracePeriod(ganeshaConfig, gracePeriod)
	if err != nil {
		return fmt.Errorf("error setting grace period to ganesha config: %v", err)
	}
	err = setFsidDevice(ganeshaConfig, true)
	if err != nil {
		return fmt.Errorf("error setting fsid device to ganesha config: %v", err)
	}

	return nil
}
211724
func setup(c *caddy.Controller) error {
	upstreams, err := NewStaticUpstreams(c.Dispenser)
	if err != nil {
		return err
	}
	httpserver.GetConfig(c).AddMiddleware(func(next httpserver.Handler) httpserver.Handler {
		return Proxy{Next: next, Upstreams: upstreams}
	})
	return nil
}
741109
func (consumer *Consumer) Setup(sarama.ConsumerGroupSession) error {
	// Mark the consumer as ready
	close(consumer.ready)
	return nil
}