chore(cmd): Move FlagClientAgentPort and flagTargetDefaultPort to uint16
This commit is contained in:
1 parent
3e3f2153c0
commit
1c62470ba6
9 files changed
+11
-11
No files matched your search
@@ -116,7 +116,7 @@ type Command struct {
|
||||
FlagSkipCacheDaemon bool
|
||||
FlagSkipClientAgent bool
|
||||
|
||||
FlagClientAgentPort uint64
|
||||
FlagClientAgentPort uint16
|
||||
|
||||
FlagScopeId string
|
||||
FlagScopeName string
|
||||
@@ -500,7 +500,7 @@ func (c *Command) FlagSet(bit FlagSetBit) *FlagSets {
|
||||
Hidden: true,
|
||||
})
|
||||
|
||||
f.Uint64Var(&Uint64Var{
|
||||
f.Uint16Var(&Uint16Var{
|
||||
Name: "client-agent-port",
|
||||
Target: &c.FlagClientAgentPort,
|
||||
Default: 9300,
|
||||
|
||||
@@ -122,7 +122,7 @@ type Server struct {
|
||||
DevSecondaryTargetId string // Target using host sources.
|
||||
DevHostAddress string // Host address for target using host sources.
|
||||
DevTargetAddress string // Network address for target with address.
|
||||
DevTargetDefaultPort int64
|
||||
DevTargetDefaultPort uint16
|
||||
DevTargetSessionMaxSeconds int64
|
||||
DevTargetSessionConnectionLimit int64
|
||||
DevLoopbackPluginId string
|
||||
|
||||
@@ -30,7 +30,7 @@ type UpsertTokenRequest struct {
|
||||
// The passed in cli.Ui is used to print out any errors when looking up the
|
||||
// auth token from the keyring. This allows background operations calling this
|
||||
// method to pass in a silent UI to suppress any output.
|
||||
func addToken(ctx context.Context, apiClient *api.Client, port uint64) (*api.Response, *api.Error, error) {
|
||||
func addToken(ctx context.Context, apiClient *api.Client, port uint16) (*api.Response, *api.Error, error) {
|
||||
pa := UpsertTokenRequest{
|
||||
BoundaryAddr: apiClient.Addr(),
|
||||
}
|
||||
|
||||
@@ -67,6 +67,6 @@ func (c *ClientAgentCommand) Run(args []string) int {
|
||||
}
|
||||
|
||||
// clientAgentUrl constructs the full URL for a client agent request given a port and path.
|
||||
func clientAgentUrl(port uint64, path string) string {
|
||||
func clientAgentUrl(port uint16, path string) string {
|
||||
return fmt.Sprintf("http://localhost:%d/%s", port, path)
|
||||
}
|
||||
@@ -53,7 +53,7 @@ func (c *PauseCommand) Flags() *base.FlagSets {
|
||||
Usage: "Instead of executing the request, print an equivalent cURL command string and exit.",
|
||||
})
|
||||
|
||||
f.Uint64Var(&base.Uint64Var{
|
||||
f.Uint16Var(&base.Uint16Var{
|
||||
Name: "client-agent--port",
|
||||
Target: &c.FlagClientAgentPort,
|
||||
Default: 9300,
|
||||
|
||||
@@ -53,7 +53,7 @@ func (c *ResumeCommand) Flags() *base.FlagSets {
|
||||
Usage: "Instead of executing the request, print an equivalent cURL command string and exit.",
|
||||
})
|
||||
|
||||
f.Uint64Var(&base.Uint64Var{
|
||||
f.Uint16Var(&base.Uint16Var{
|
||||
Name: "client-agent-port",
|
||||
Target: &c.FlagClientAgentPort,
|
||||
Default: 9300,
|
||||
|
||||
@@ -58,7 +58,7 @@ func (c *SessionsCommand) Flags() *base.FlagSets {
|
||||
Usage: "Instead of executing the request, print an equivalent cURL command string and exit.",
|
||||
})
|
||||
|
||||
f.Uint64Var(&base.Uint64Var{
|
||||
f.Uint16Var(&base.Uint16Var{
|
||||
Name: "client-agent-port",
|
||||
Target: &c.FlagClientAgentPort,
|
||||
Default: 9300,
|
||||
|
||||
@@ -54,7 +54,7 @@ func (c *StatusCommand) Flags() *base.FlagSets {
|
||||
Usage: "Instead of executing the request, print an equivalent cURL command string and exit.",
|
||||
})
|
||||
|
||||
f.Uint64Var(&base.Uint64Var{
|
||||
f.Uint16Var(&base.Uint16Var{
|
||||
Name: "client-agent-port",
|
||||
Target: &c.FlagClientAgentPort,
|
||||
Default: 9300,
|
||||
|
||||
@@ -76,7 +76,7 @@ type Command struct {
|
||||
flagIdSuffix string
|
||||
flagSecondaryIdSuffix string
|
||||
flagHostAddress string
|
||||
flagTargetDefaultPort int64
|
||||
flagTargetDefaultPort uint16
|
||||
flagTargetSessionMaxSeconds int64
|
||||
flagTargetSessionConnectionLimit int64
|
||||
flagControllerApiListenAddr string
|
||||
@@ -219,7 +219,7 @@ func (c *Command) Flags() *base.FlagSets {
|
||||
Usage: "Address to use for the default host that is created. Must be a bare host or IP address, no port.",
|
||||
})
|
||||
|
||||
f.Int64Var(&base.Int64Var{
|
||||
f.Uint16Var(&base.Uint16Var{
|
||||
Name: "target-default-port",
|
||||
Default: 22,
|
||||
Target: &c.flagTargetDefaultPort,
|
||||
|
||||
Reference in new issue
Block a user