-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Harsh Desai <[email protected]>
- Loading branch information
Showing
107 changed files
with
49,834 additions
and
44 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 |
---|---|---|
@@ -1,7 +1,77 @@ | ||
package main | ||
|
||
import "github.com/sirupsen/logrus" | ||
import ( | ||
"flag" | ||
"github.com/libopenstorage/openstorage/api" | ||
"github.com/sirupsen/logrus" | ||
"github.com/spf13/cobra" | ||
"k8s.io/kubectl/pkg/cmd/util" | ||
"os" | ||
) | ||
|
||
var ( | ||
namespace string | ||
) | ||
|
||
// listvols list all volumes in provided namespace | ||
func listvols(namespace string) ([]*api.Volume, error) { | ||
return nil, nil | ||
} | ||
|
||
func attachVol(vol *api.Volume) error { | ||
return nil | ||
} | ||
|
||
func createVol(vol *api.Volume) (*api.Volume, error) { | ||
return nil, nil | ||
} | ||
|
||
func snapVol(vol *api.Volume) (*api.Volume, error) { | ||
return nil, nil | ||
} | ||
|
||
func cloneVol(vol *api.Volume) (*api.Volume, error) { | ||
return nil, nil | ||
} | ||
|
||
func main() { | ||
logrus.Infof("Hello from 3ncryptor") | ||
if err := NewCommand().Execute(); err != nil { | ||
os.Exit(1) | ||
} | ||
} | ||
|
||
|
||
// NewCommand returns a restic command wrapper | ||
func NewCommand() *cobra.Command { | ||
cmds := &cobra.Command{ | ||
Use: "restic_executor", | ||
Short: "a command executor for long running restic commands", | ||
} | ||
|
||
cmds.PersistentFlags().StringVarP(&namespace, "namespace", "n", "", "Namespace for this command") | ||
|
||
cmds.AddCommand( | ||
newEncryptCommand(), | ||
) | ||
cmds.PersistentFlags().AddGoFlagSet(flag.CommandLine) | ||
err := flag.CommandLine.Parse([]string{}) | ||
if err != nil { | ||
util.CheckErr(err) | ||
return nil | ||
} | ||
|
||
return cmds | ||
} | ||
|
||
func newEncryptCommand() *cobra.Command { | ||
encCommand := &cobra.Command{ | ||
Use: "encrypt", | ||
Short: "Start encryption", | ||
Run: func(c *cobra.Command, args []string) { | ||
logrus.Infof("Hello from 3ncryptor: encrypt") | ||
|
||
}, | ||
} | ||
return encCommand | ||
} |
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 @@ | ||
go run 3ncryptor.go encrypt |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.