// SetUp creates new directory and clones a git repo.
490579
func (b *gitRepoVolumeMounter) SetUp(fsGroup *int64) error {
	return b.SetUpAt(b.GetPath(), fsGroup)
}
67889
func (f *flexVolumeMounter) SetUp(fsGroup *int64) error {
	return f.SetUpAt(f.GetPath(), fsGroup)
}
913496
func setup(c *caddy.Controller) error {
	cfg := httpserver.GetConfig(c)
	root := cfg.Root

	rules, err := basicAuthParse(c)
	if err != nil {
		return err
	}

	basic := BasicAuth{Rules: rules}

	cfg.AddMiddleware(func(next httpserver.Handler) httpserver.Handler {
		basic.Next = next
		basic.SiteRoot = root
		return basic
	})

	return nil
}
366809
func Setup(conf config.Config) error {
	getDownlinkDataDelay = conf.NetworkServer.GetDownlinkDataDelay
	disableMACCommands = conf.NetworkServer.NetworkSettings.DisableMACCommands

	return nil
}
602359
func Setup(app *ccli.App, options ...micro.Option) {
	app.Commands = append(app.Commands, api.Commands(options...)...)
	app.Commands = append(app.Commands, bot.Commands()...)
	app.Commands = append(app.Commands, cli.Commands()...)
	app.Commands = append(app.Commands, proxy.Commands(options...)...)
	app.Commands = append(app.Commands, service.Commands(options...)...)
	app.Commands = append(app.Commands, new.Commands()...)
	app.Commands = append(app.Commands, web.Commands(options...)...)
	app.Action = func(context *ccli.Context) { ccli.ShowAppHelp(context) }

	setup(app)
}
496464
func (b *azureFileMounter) SetUp(fsGroup *int64) error {
	return b.SetUpAt(b.GetPath(), fsGroup)
}
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
}
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()
}
11868
func (r *redisRequester) Setup() error {
	conn, err := redis.Dial("tcp", r.url)
	if err != nil {
		return err
	}
	r.conn = conn
	return nil
}
1337213
func Setup(conf config.Config) error {
	keks = make(map[string][]byte)

	netID = conf.NetworkServer.NetID
	rx2DR = conf.NetworkServer.NetworkSettings.RX2DR
	rx1DROffset = conf.NetworkServer.NetworkSettings.RX1DROffset
	rx1Delay = conf.NetworkServer.NetworkSettings.RX1Delay

	for _, k := range conf.JoinServer.KEK.Set {
		kek, err := hex.DecodeString(k.KEK)
		if err != nil {
			return errors.Wrap(err, "decode kek error")
		}

		keks[k.Label] = kek
	}

	return nil
}
351527
func (t TestModule) Setup() (err error) {
	set := flag.NewFlagSet(t.command.Name, flag.PanicOnError)
	for _, f := range t.command.Flags {
		f.Apply(set)
	}

	t.context = cli.NewContext(nil, set, nil)

	if t.command.Before != nil {
		if err = t.command.Before(t.context); err != nil {
			return
		}
	}
	if t.command.Action != nil {
		if err = t.command.Action(t.context); err != nil {
			return
		}
	}

	return
}
441242
func (b *flockerVolumeMounter) SetUp(fsGroup *int64) error {
	return b.SetUpAt(b.GetPath(), fsGroup)
}
863072
func setup(c *caddy.Controller) error {
	rules, err := parsePushRules(c)

	if err != nil {
		return err
	}

	cfg := httpserver.GetConfig(c)
	cfg.AddMiddleware(func(next httpserver.Handler) httpserver.Handler {
		return Middleware{Next: next, Rules: rules, Root: http.Dir(cfg.Root), indexPages: cfg.IndexPages}
	})

	return nil
}
685849
func Setup(opts r.ConnectOpts) error {
	// Initialize a new setup connection
	ss, err := r.Connect(opts)
	if err != nil {
		return err
	}

	// Create databases
	for _, d := range databaseNames {
		r.DBCreate(d).Exec(ss)

		r.DB(d).TableCreate("accounts").Exec(ss)
		r.DB(d).Table("accounts").IndexCreate("name").Exec(ss)
		r.DB(d).Table("accounts").IndexCreate("date_created").Exec(ss)
		r.DB(d).Table("accounts").IndexCreate("date_modified").Exec(ss)
		r.DB(d).Table("accounts").IndexCreate("alt_email").Exec(ss)
		r.DB(d).Table("accounts").IndexCreate("type").Exec(ss)
		r.DB(d).Table("accounts").IndexCreate("status").Exec(ss)

		r.DB(d).TableCreate("addresses").Exec(ss)
		r.DB(d).Table("addresses").IndexCreate("owner").Exec(ss)
		r.DB(d).Table("addresses").IndexCreate("date_created").Exec(ss)
		r.DB(d).Table("addresses").IndexCreate("date_modified").Exec(ss)

		r.DB(d).TableCreate("contacts").Exec(ss)
		r.DB(d).Table("contacts").IndexCreate("owner").Exec(ss)
		r.DB(d).Table("contacts").IndexCreate("name").Exec(ss)
		r.DB(d).Table("contacts").IndexCreate("date_created").Exec(ss)
		r.DB(d).Table("contacts").IndexCreate("date_modified").Exec(ss)

		r.DB(d).TableCreate("emails").Exec(ss)
		r.DB(d).Table("emails").IndexCreate("owner").Exec(ss)
		r.DB(d).Table("emails").IndexCreate("date_created").Exec(ss)
		r.DB(d).Table("emails").IndexCreate("date_modified").Exec(ss)
		r.DB(d).Table("emails").IndexCreate("thread").Exec(ss)
		r.DB(d).Table("emails").IndexCreate("kind").Exec(ss)
		r.DB(d).Table("emails").IndexCreate("from").Exec(ss)
		r.DB(d).Table("emails").IndexCreate("message_id").Exec(ss)
		r.DB(d).Table("emails").IndexCreate("to", r.IndexCreateOpts{Multi: true}).Exec(ss)
		r.DB(d).Table("emails").IndexCreate("cc", r.IndexCreateOpts{Multi: true}).Exec(ss)
		r.DB(d).Table("emails").IndexCreate("bcc", r.IndexCreateOpts{Multi: true}).Exec(ss)
		r.DB(d).Table("emails").IndexCreateFunc("messageIDOwner", func(row r.Term) interface{} {
			return []interface{}{
				row.Field("message_id"),
				row.Field("owner"),
			}
		}).Exec(ss)
		r.DB(d).Table("emails").IndexCreateFunc("threadStatus", func(row r.Term) interface{} {
			return []interface{}{
				row.Field("thread"),
				row.Field("status"),
			}
		}).Exec(ss)

		r.DB(d).TableCreate("files").Exec(ss)
		r.DB(d).Table("files").IndexCreate("owner").Exec(ss)
		r.DB(d).Table("files").IndexCreate("name").Exec(ss)
		r.DB(d).Table("files").IndexCreate("date_created").Exec(ss)
		r.DB(d).Table("files").IndexCreate("date_modified").Exec(ss)

		r.DB(d).TableCreate("keys").Exec(ss)
		r.DB(d).Table("keys").IndexCreate("owner").Exec(ss)
		r.DB(d).Table("keys").IndexCreate("date_created").Exec(ss)
		r.DB(d).Table("keys").IndexCreate("date_modified").Exec(ss)
		r.DB(d).Table("keys").IndexCreate("key_id").Exec(ss)

		r.DB(d).TableCreate("labels").Exec(ss)
		r.DB(d).Table("labels").IndexCreate("name").Exec(ss)
		r.DB(d).Table("labels").IndexCreate("builtin").Exec(ss)
		r.DB(d).Table("labels").IndexCreate("owner").Exec(ss)
		r.DB(d).Table("labels").IndexCreateFunc("nameOwnerBuiltin", func(row r.Term) interface{} {
			return []interface{}{
				row.Field("name"),
				row.Field("owner"),
				row.Field("builtin"),
			}
		}).Exec(ss)

		r.DB(d).TableCreate("threads").Exec(ss)
		r.DB(d).Table("threads").IndexCreate("name").Exec(ss)
		r.DB(d).Table("threads").IndexCreate("owner").Exec(ss)
		r.DB(d).Table("threads").IndexCreate("date_created").Exec(ss)
		r.DB(d).Table("threads").IndexCreate("date_modified").Exec(ss)
		r.DB(d).Table("threads").IndexCreate("emails", r.IndexCreateOpts{Multi: true}).Exec(ss)
		r.DB(d).Table("threads").IndexCreate("labels", r.IndexCreateOpts{Multi: true}).Exec(ss)
		r.DB(d).Table("threads").IndexCreate("members", r.IndexCreateOpts{Multi: true}).Exec(ss)
		r.DB(d).Table("threads").IndexCreate("subject_hash").Exec(ss)
		r.DB(d).Table("threads").IndexCreate("secure").Exec(ss)
		r.DB(d).Table("threads").IndexCreateFunc("subjectOwner", func(row r.Term) interface{} {
			return []interface{}{
				row.Field("subject_hash"),
				row.Field("owner"),
			}
		}).Exec(ss)

		r.DB(d).TableCreate("tokens").Exec(ss)
		r.DB(d).Table("tokens").IndexCreate("name").Exec(ss)
		r.DB(d).Table("tokens").IndexCreate("owner").Exec(ss)
		r.DB(d).Table("tokens").IndexCreate("date_created").Exec(ss)
		r.DB(d).Table("tokens").IndexCreate("date_modified").Exec(ss)
		r.DB(d).Table("tokens").IndexCreate("type").Exec(ss)
		r.DB(d).Table("tokens").IndexCreate("expiry_date").Exec(ss)

		r.DB(d).TableCreate("webhooks").Exec(ss)
		r.DB(d).Table("webhooks").IndexCreate("target").Exec(ss)
		r.DB(d).Table("webhooks").IndexCreate("type").Exec(ss)
		r.DB(d).Table("webhooks").IndexCreateFunc("targetType", func(row r.Term) interface{} {
			return []interface{}{
				row.Field("target"),
				row.Field("type"),
			}
		}).Exec(ss)
	}

	return ss.Close()
}
663588
func setup(c *caddy.Controller) error {
	cfg := httpserver.GetConfig(c)

	rules, err := fastcgiParse(c)
	if err != nil {
		return err
	}

	cfg.AddMiddleware(func(next httpserver.Handler) httpserver.Handler {
		return Handler{
			Next:            next,
			Rules:           rules,
			Root:            cfg.Root,
			FileSys:         http.Dir(cfg.Root),
			SoftwareName:    caddy.AppName,
			SoftwareVersion: caddy.AppVersion,
			ServerName:      cfg.Addr.Host,
			ServerPort:      cfg.Addr.Port,
		}
	})

	return nil
}
594678
func (s *Service) setup() error {
	for _, m := range s.modules {
		n := getModuleName(m)
		c := s.configs[n]
		if c.Setup != nil {
			BootPrintln("[service] setup", n)
			err := c.Setup()
			if err != nil {
				return err
			}
		}

		if s.Env.IsTest() && c.SetupTest != nil {
			BootPrintln("[service] setup for test", n)
			c.SetupTest()
		}
	}
	return nil
}
822995
func (g *Git) Add(ctx context.Context, files ...string) error {
	if !g.IsInitialized() {
		return store.ErrGitNotInit
	}

	for i := range files {
		files[i] = strings.TrimPrefix(files[i], g.path+"/")
	}

	args := []string{"add", "--all", "--force"}
	args = append(args, files...)

	return g.Cmd(ctx, "gitAdd", args...)
}