Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CAP
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
CAP
Commits
7766d408
Commit
7766d408
authored
Sep 26, 2017
by
Savorboard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor and remove files.
parent
5a00edda
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
79 deletions
+0
-79
HostAndPort.cs
src/DotNetCore.CAP/Dashboard/GatewayProxy/HostAndPort.cs
+0
-14
IRequestScopedDataRepository.HttpData.cs
...ard/GatewayProxy/IRequestScopedDataRepository.HttpData.cs
+0
-56
IRequestScopedDataRepository.cs
...AP/Dashboard/GatewayProxy/IRequestScopedDataRepository.cs
+0
-9
No files found.
src/DotNetCore.CAP/Dashboard/GatewayProxy/HostAndPort.cs
deleted
100644 → 0
View file @
5a00edda
namespace
DotNetCore.CAP.Dashboard.GatewayProxy
{
public
class
HostAndPort
{
public
HostAndPort
(
string
downstreamHost
,
int
downstreamPort
)
{
DownstreamHost
=
downstreamHost
?.
Trim
(
'/'
);
DownstreamPort
=
downstreamPort
;
}
public
string
DownstreamHost
{
get
;
private
set
;
}
public
int
DownstreamPort
{
get
;
private
set
;
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/GatewayProxy/IRequestScopedDataRepository.HttpData.cs
deleted
100644 → 0
View file @
5a00edda
using
System
;
using
System.Collections.Concurrent
;
using
Microsoft.AspNetCore.Http
;
namespace
DotNetCore.CAP.Dashboard.GatewayProxy
{
public
class
HttpDataRepository
:
IRequestScopedDataRepository
{
private
readonly
IHttpContextAccessor
_httpContextAccessor
;
public
HttpDataRepository
(
IHttpContextAccessor
httpContextAccessor
)
{
_httpContextAccessor
=
httpContextAccessor
;
}
public
void
Add
<
T
>(
string
key
,
T
value
)
{
_httpContextAccessor
.
HttpContext
.
Items
.
Add
(
key
,
value
);
}
public
T
Get
<
T
>(
string
key
)
{
object
obj
;
if
(
_httpContextAccessor
.
HttpContext
.
Items
.
TryGetValue
(
key
,
out
obj
))
{
return
(
T
)
obj
;
}
throw
new
Exception
(
$"Unable to find data for key:
{
key
}
"
);
}
}
public
class
ScopedDataRepository
:
IRequestScopedDataRepository
{
private
readonly
ConcurrentDictionary
<
string
,
object
>
dictionary
=
null
;
public
ScopedDataRepository
()
{
dictionary
=
new
ConcurrentDictionary
<
string
,
object
>();
}
public
void
Add
<
T
>(
string
key
,
T
value
)
{
dictionary
.
AddOrUpdate
(
key
,
value
,
(
k
,
v
)
=>
value
);
}
public
T
Get
<
T
>(
string
key
)
{
if
(
dictionary
.
TryGetValue
(
key
,
out
object
t
))
{
return
(
T
)
t
;
}
throw
new
Exception
(
$"Unable to find data for key:
{
key
}
"
);
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Dashboard/GatewayProxy/IRequestScopedDataRepository.cs
deleted
100644 → 0
View file @
5a00edda
namespace
DotNetCore.CAP.Dashboard.GatewayProxy
{
public
interface
IRequestScopedDataRepository
{
void
Add
<
T
>(
string
key
,
T
value
);
T
Get
<
T
>(
string
key
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment