Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Rdpgw
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirror
Rdpgw
Commits
93b31ec9
Commit
93b31ec9
authored
4 years ago
by
Bolke de Bruin
Browse files
Options
Downloads
Patches
Plain Diff
Further cleanups
parent
354355e6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
errors.go
+0
-55
0 additions, 55 deletions
errors.go
protocol/rdpgw.go
+0
-7
0 additions, 7 deletions
protocol/rdpgw.go
with
0 additions
and
62 deletions
errors.go
deleted
100644 → 0
+
0
−
55
View file @
354355e6
package
main
import
"github.com/bolkedebruin/rdpgw/protocol"
// RejectOption represents an option used to control the way connection is
// rejected.
type
RejectOption
func
(
*
rejectConnectionError
)
// RejectionReason returns an option that makes connection to be rejected with
// given reason.
func
RejectionReason
(
reason
string
)
RejectOption
{
return
func
(
err
*
rejectConnectionError
)
{
err
.
reason
=
reason
}
}
// RejectionStatus returns an option that makes connection to be rejected with
// given HTTP status code.
func
RejectionStatus
(
code
int
)
RejectOption
{
return
func
(
err
*
rejectConnectionError
)
{
err
.
code
=
code
}
}
// RejectionHeader returns an option that makes connection to be rejected with
// given HTTP headers.
func
RejectionHeader
(
h
protocol
.
HandshakeHeader
)
RejectOption
{
return
func
(
err
*
rejectConnectionError
)
{
err
.
header
=
h
}
}
// RejectConnectionError constructs an error that could be used to control the way
// handshake is rejected by Upgrader.
func
RejectConnectionError
(
options
...
RejectOption
)
error
{
err
:=
new
(
rejectConnectionError
)
for
_
,
opt
:=
range
options
{
opt
(
err
)
}
return
err
}
// rejectConnectionError represents a rejection of upgrade error.
//
// It can be returned by Upgrader's On* hooks to control the way WebSocket
// handshake is rejected.
type
rejectConnectionError
struct
{
reason
string
code
int
header
protocol
.
HandshakeHeader
}
// Error implements error interface.
func
(
r
*
rejectConnectionError
)
Error
()
string
{
return
r
.
reason
}
This diff is collapsed.
Click to expand it.
protocol/rdpgw.go
+
0
−
7
View file @
93b31ec9
...
@@ -5,7 +5,6 @@ import (
...
@@ -5,7 +5,6 @@ import (
"github.com/gorilla/websocket"
"github.com/gorilla/websocket"
"github.com/patrickmn/go-cache"
"github.com/patrickmn/go-cache"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus"
"io"
"log"
"log"
"net/http"
"net/http"
"time"
"time"
...
@@ -40,12 +39,6 @@ var (
...
@@ -40,12 +39,6 @@ var (
})
})
)
)
// HandshakeHeader is the interface that writes both upgrade request or
// response headers into a given io.Writer.
type
HandshakeHeader
interface
{
io
.
WriterTo
}
type
SessionInfo
struct
{
type
SessionInfo
struct
{
ConnId
string
ConnId
string
CorrelationId
string
CorrelationId
string
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment