Beispiel #1
0
        public static IServiceCollection CloudFoundryInfoConfigureServices(this IServiceCollection services, IConfiguration Configuration)
        {
            string port            = Configuration.GetValue <string>("PORT", "PORT not configured.");
            string memoryLimit     = Configuration.GetValue <string>("MEMORY_LIMIT", "MEMORY_LIMIT not configured.");
            string cfInstanceIndex = Configuration.GetValue <string>("CF_INSTANCE_INDEX", "CF_INSTANCE_INDEX not configured.");
            string cfInstanceAddr  = Configuration.GetValue <string>("CF_INSTANCE_ADDR", "CF_INSTANCE_ADDR not configured.");


            CloudFoundryInfo info = new CloudFoundryInfo(port, memoryLimit, cfInstanceIndex, cfInstanceAddr);

            services.AddSingleton(info);

            return(services);
        }
Beispiel #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            var ci = new CloudFoundryInfo(
                Configuration.GetValue <string>("PORT", "PORT not configured."),
                Configuration.GetValue <string>("MEMORY_LIMIT", "MEMORY_LIMIT not configured."),
                Configuration.GetValue <string>("CF_INSTANCE_INDEX", "CF_INSTANCE_INDEX not configured."),
                Configuration.GetValue <string>("CF_INSTANCE_ADDR", "CF_INSTANCE_ADDR not configured."));

            services.AddSingleton(ci);

            services.AddSingleton <IHealthContributor, TimeEntryHealthContributor>();
            services.AddCloudFoundryActuators(Configuration);
            services.AddSingleton(sp => new WelcomeMessage(Configuration.GetValue <string>("WELCOME_MESSAGE", "WELCOME_MESSAGE not configured.")));
            services.AddDbContext <TimeEntryContext>(options => options.UseMySql(Configuration));
            services.AddScoped <ITimeEntryRepository, MySqlTimeEntryRepository>();
            services.AddSingleton <IOperationCounter <TimeEntry>, OperationCounter <TimeEntry> >();
            services.AddSingleton <IInfoContributor, TimeEntryInfoContributor>();
        }
Beispiel #3
0
 public EnvController(CloudFoundryInfo cloudFoundryEnv)
 {
     _cloudFoundryEnv = cloudFoundryEnv;
 }
Beispiel #4
0
 public EnvController(CloudFoundryInfo info)
 {
     _info = info ?? throw new ArgumentNullException(nameof(info));
 }
Beispiel #5
0
 public EnvController(CloudFoundryInfo cloud_foundry_info)
 {
     _cloudFoundryInfo = cloud_foundry_info;
 }
        public EnvController(CloudFoundryInfo cloudFoundryEnv)
        {
            //CHANGE THAT DOES NOT MATTER

            _cloudFoundryEnv = cloudFoundryEnv;
        }
Beispiel #7
0
 public EnvController(CloudFoundryInfo cloudFoundryInfo)
 {
     this._cloudFoundryInfo = cloudFoundryInfo;
 }
 public EnvController(CloudFoundryInfo _cloudinfo)
 {
     cloudinfo = _cloudinfo;
 }
Beispiel #9
0
 public EnvController(CloudFoundryInfo info)
 {
     _info = info;
 }
Beispiel #10
0
 public EnvController(CloudFoundryInfo message)
 {
     _message = message;
 }