-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtypes.go
More file actions
66 lines (57 loc) · 1.6 KB
/
types.go
File metadata and controls
66 lines (57 loc) · 1.6 KB
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
62
63
64
65
66
package proxies
import (
"context"
"github.com/kernel/kernel-go-sdk"
"github.com/kernel/kernel-go-sdk/option"
)
// ProxyService defines the subset of the Kernel SDK proxy client that we use.
type ProxyService interface {
List(ctx context.Context, opts ...option.RequestOption) (res *[]kernel.ProxyListResponse, err error)
Get(ctx context.Context, id string, opts ...option.RequestOption) (res *kernel.ProxyGetResponse, err error)
New(ctx context.Context, body kernel.ProxyNewParams, opts ...option.RequestOption) (res *kernel.ProxyNewResponse, err error)
Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)
Check(ctx context.Context, id string, body kernel.ProxyCheckParams, opts ...option.RequestOption) (res *kernel.ProxyCheckResponse, err error)
}
// ProxyCmd handles proxy operations independent of cobra.
type ProxyCmd struct {
proxies ProxyService
}
// Input types for proxy operations
type ProxyListInput struct {
Output string
}
type ProxyGetInput struct {
ID string
Output string
}
type ProxyCreateInput struct {
Name string
Type string
Protocol string
// Hostnames that should bypass the parent proxy and connect directly.
BypassHosts []string
// Datacenter/ISP config
Country string
// Residential/Mobile config
City string
State string
Zip string
ASN string
OS string
// Mobile specific
Carrier string
// Custom proxy config
Host string
Port int
Username string
Password string
Output string
}
type ProxyDeleteInput struct {
ID string
SkipConfirm bool
}
type ProxyCheckInput struct {
ID string
Output string
}