-
Notifications
You must be signed in to change notification settings - Fork 64
/
domain.go
61 lines (49 loc) · 1.27 KB
/
domain.go
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package config
type domainOption string
// WithDomain sets the fully-qualified domain name for this edge.
//
// https://ngrok.com/docs/network-edge/domains-and-tcp-addresses/#domains
func WithDomain(name string) interface {
HTTPEndpointOption
TLSEndpointOption
} {
return domainOption(name)
}
func (opt domainOption) ApplyHTTP(opts *httpOptions) {
opts.Domain = string(opt)
}
func (opt domainOption) ApplyTLS(opts *tlsOptions) {
opts.Domain = string(opt)
}
type hostnameOption string
// WithHostname sets the hostname for this edge.
//
// Deprecated: use WithDomain instead
func WithHostname(name string) interface {
HTTPEndpointOption
TLSEndpointOption
} {
return hostnameOption(name)
}
func (opt hostnameOption) ApplyHTTP(opts *httpOptions) {
opts.Hostname = string(opt)
}
func (opt hostnameOption) ApplyTLS(opts *tlsOptions) {
opts.Hostname = string(opt)
}
type subdomainOption string
// WithSubdomain sets the subdomain for this edge.
//
// Deprecated: use WithDomain instead
func WithSubdomain(name string) interface {
HTTPEndpointOption
TLSEndpointOption
} {
return subdomainOption(name)
}
func (opt subdomainOption) ApplyHTTP(opts *httpOptions) {
opts.Subdomain = string(opt)
}
func (opt subdomainOption) ApplyTLS(opts *tlsOptions) {
opts.Subdomain = string(opt)
}