-
-
Notifications
You must be signed in to change notification settings - Fork 400
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: I33f190b5bf1d466474c7b1b97dc44c73524d6061 Reviewed-on: https://softwarefactory-project.io/r/5689 Reviewed-by: Sylvain Afchain <safchain@gmail.com> Tested-by: Sylvain Afchain <safchain@gmail.com> Workflow: Sylvain Afchain <safchain@gmail.com> Tested-by: Jenkins CI <jenkins@softwarefactory-project.io>
- Loading branch information
Showing
12 changed files
with
162 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
* | ||
*/ | ||
|
||
package agent | ||
package cmd | ||
|
||
import ( | ||
"os" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
* | ||
*/ | ||
|
||
package allinone | ||
package cmd | ||
|
||
import ( | ||
"os" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
* | ||
*/ | ||
|
||
package analyzer | ||
package cmd | ||
|
||
import ( | ||
"os" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright (C) 2016 Red Hat, Inc. | ||
* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
*/ | ||
|
||
package cmd | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/skydive-project/skydive/cmd/client" | ||
"github.com/skydive-project/skydive/config" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var analyzerAddr string | ||
|
||
var Client = &cobra.Command{ | ||
Use: "client", | ||
Short: "Skydive client", | ||
Long: "Skydive client", | ||
SilenceUsage: true, | ||
PersistentPreRun: func(cmd *cobra.Command, args []string) { | ||
cmd.Root().PersistentPreRun(cmd.Root(), args) | ||
if analyzerAddr != "" { | ||
config.GetConfig().Set("agent.analyzers", analyzerAddr) | ||
} else { | ||
config.GetConfig().SetDefault("agent.analyzers", "localhost:8082") | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
Client.PersistentFlags().StringVarP(&client.AuthenticationOpts.Username, "username", "", os.Getenv("SKYDIVE_USERNAME"), "username auth parameter") | ||
Client.PersistentFlags().StringVarP(&client.AuthenticationOpts.Password, "password", "", os.Getenv("SKYDIVE_PASSWORD"), "password auth parameter") | ||
Client.PersistentFlags().StringVarP(&analyzerAddr, "analyzer", "", os.Getenv("SKYDIVE_ANALYZER"), "analyzer address") | ||
|
||
Client.AddCommand(client.AlertCmd) | ||
Client.AddCommand(client.CaptureCmd) | ||
Client.AddCommand(client.TopologyCmd) | ||
Client.AddCommand(client.ShellCmd) | ||
Client.AddCommand(client.PacketInjectorCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (C) 2016 Red Hat, Inc. | ||
* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
*/ | ||
|
||
package cmd | ||
|
||
import ( | ||
"github.com/skydive-project/skydive/version" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var VersionCmd = &cobra.Command{ | ||
Use: "version", | ||
Short: "Print the version number of Skydive", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
version.PrintVersion() | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright (C) 2016 Red Hat, Inc. | ||
* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
*/ | ||
|
||
package main | ||
|
||
import "github.com/skydive-project/skydive/cmd" | ||
|
||
func main() { | ||
cmd.RootCmd.Execute() | ||
} |