FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cloudflared/config/model.go at master · CloudEngineHub/cloudflared · GitHub
CloudEngineHub
/
cloudflared
Public
forked from
cloudflare/cloudflared
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cloudflared
/
config
/
model.go
Copy path
More file actions
More file actions
Latest commit
History
History
History
44 lines (39 loc) · 1.47 KB
Breadcrumbs
cloudflared
/
config
/
model.go
Copy path
File metadata and controls
44 lines (39 loc) · 1.47 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package
config
import
(
"crypto/sha256"
"fmt"
"io"
)
// Forwarder represents a client side listener to forward traffic to the edge
type
Forwarder
struct
{
URL
string
`json:"url"`
Listener
string
`json:"listener"`
TokenClientID
string
`json:"service_token_id" yaml:"serviceTokenID"`
TokenSecret
string
`json:"secret_token_id" yaml:"serviceTokenSecret"`
Destination
string
`json:"destination"`
IsFedramp
bool
`json:"is_fedramp" yaml:"isFedramp"`
}
// Tunnel represents a tunnel that should be started
type
Tunnel
struct
{
URL
string
`json:"url"`
Origin
string
`json:"origin"`
ProtocolType
string
`json:"type"`
}
// Root is the base options to configure the service.
type
Root
struct
{
LogDirectory
string
`json:"log_directory" yaml:"logDirectory,omitempty"`
LogLevel
string
`json:"log_level" yaml:"logLevel,omitempty"`
Forwarders
[]
Forwarder
`json:"forwarders,omitempty" yaml:"forwarders,omitempty"`
Tunnels
[]
Tunnel
`json:"tunnels,omitempty" yaml:"tunnels,omitempty"`
// `resolver` key is reserved for a removed feature (proxy-dns) and should not be used.
}
// Hash returns the computed values to see if the forwarder values change
func
(
f
*
Forwarder
)
Hash
()
string
{
h
:=
sha256
.
New
()
_
,
_
=
io
.
WriteString
(
h
,
f
.
URL
)
_
,
_
=
io
.
WriteString
(
h
,
f
.
Listener
)
_
,
_
=
io
.
WriteString
(
h
,
f
.
TokenClientID
)
_
,
_
=
io
.
WriteString
(
h
,
f
.
TokenSecret
)
_
,
_
=
io
.
WriteString
(
h
,
f
.
Destination
)
return
fmt
.
Sprintf
(
"%x"
,
h
.
Sum
(
nil
))
}
Back
|
FazBrowse Home
|
New Git URL