public SettingsEndpoint(AppSettings settings) : base("/settings") { _settings = settings; Get["/"] = _ => _settings; }
public DcsScm(AppSettings settings, DcsFilesystem dcsFiles, Users users, ScmClient scm) { _settings = settings; _dcsFiles = dcsFiles; _users = users; _scm = scm; }
public SolutionRunner(ILog log, AppSettings settings, PortReservations reservations, Shell shell) { _log = log; _settings = settings; _reservations = reservations; _shell = shell; }
public static IBus ReGisterReBusBus( this IContainer container, AppSettings settings, string applicationName) { string inputQueue = applicationName + ".input"; string errorQueue = applicationName + ".error"; var adapter = new AutofacContainerAdapter(container); var bus = Configure.With(adapter) .Logging(l => l.Log4Net()) .Transport(t => t.UseSqlServer(settings.Env.DcsDbConn, "BusTransport", inputQueue, errorQueue) .EnsureTableIsCreated()) .Serialization(s => s.UseJsonSerializer()) .MessageOwnership(m => m.Use(new SingleDestinationMessageOwnership(inputQueue))) .Subscriptions(s => s.StoreInSqlServer(settings.Env.DcsDbConn, "BusSubscription") .EnsureTableIsCreated()) .Behavior(b => b.SetMaxRetriesFor<Exception>(1)) .CreateBus() .Start(); return bus; }
static void Main(string[] args) { HostFactory.Run(configure => { configure.Service<DcsUserServicesApp>(s => { s.ConstructUsing(name => new DcsUserServicesApp()); s.WhenStarted(sh => sh.Start()); s.WhenStopped(sh => sh.Stop()); }); var settings = new AppSettings(); configure.MustUseLog4Net("dcs.userServices.log4net.config"); configure.RunAs( @"{0}\{1}".FormatWith(Environment.MachineName, settings.Env.SolutionExecUsername), settings.Env.SolutionExecPassword); configure.SetDescription("CodeFlight Design Services User Host"); configure.SetDisplayName("DCS.UserServices"); configure.SetServiceName("DCS.UserServices"); }); }
public DcsWebServicesApi(AppSettings settings, ILog log) { _settings = settings; _log = log; }
public KillOrphansOperation(AppSettings settings, ILog log) { _settings = settings; _log = log; }
public PortReservations(AppSettings settings, ILog log) { _settings = settings; _log = log; }
public UsersEndpoint(Users users, Commits commits, AppSettings settings, DcsScm scm) : base("/users") { Get["/"] = _ => { string token = Request.Query.token; if (token.ToNullableGuid() != FakeyAuth.Token) { return new Response { StatusCode = HttpStatusCode.Forbidden }; } return users.GetAll() .Select(u => { var user = new { Username = u.Username, u.Id }; return user; } ); }; Get["/{userId}"] = _ => { var user = users.Get((Guid) _.userId); if (user == null) { return new NotFoundResponse(); } var repo = user.Repositories.FirstOrDefault(); return new { Username = user.Username, user.Id, user.Email, RepositoryHref = repo == null ? null : scm.GetRepoUrl(repo.Name, user, true), Challenges = user.Challenges.Select(c => new { c.Name, c.StageNumber, c.RepositoryId }) }; }; Get["/{userId}/commits"] = _ => commits.ForUser((Guid) _.userId) .OrderByDescending(c => c.CommittedAt) .Select(c => new { c.Id, c.CommittedAt, c.UserId, c.Username, c.RepositoryId, c.RepositoryName, c.Challenge, c.CurrentStageNumber, c.ResultsUpdatedAt, c.Outcome, c.OutcomeDetail, HasTestOutput = !string.IsNullOrEmpty(c.TestOutput) }); }
public CheckRubyEnvOperation(AppSettings settings, Shell shell, ILog log) { _settings = settings; _shell = shell; _log = log; }
public DcsHrefs(AppSettings appSettings) { _appSettings = appSettings; }