mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2025-12-23 22:29:59 -05:00
initial commit
This commit is contained in:
22
.gitignore
vendored
Normal file
22
.gitignore
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Test binary, build with `go test -c`
|
||||
*.test
|
||||
|
||||
# Visual Studio Code
|
||||
.vscode
|
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||
*.out
|
||||
|
||||
# Ignore builds
|
||||
reva-hyper
|
||||
|
||||
# For Mac OS
|
||||
.DS_Store
|
||||
|
||||
8
go.mod
Normal file
8
go.mod
Normal file
@@ -0,0 +1,8 @@
|
||||
module github.com/owncloud/reva-hyper
|
||||
|
||||
go 1.12
|
||||
|
||||
require (
|
||||
github.com/owncloud/reva-phoenix v0.0.0-20190821144117-6ad779051ca6
|
||||
github.com/spf13/cobra v0.0.5
|
||||
)
|
||||
39
go.sum
Normal file
39
go.sum
Normal file
@@ -0,0 +1,39 @@
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
|
||||
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
|
||||
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/owncloud/reva-phoenix v0.0.0-20190821133836-432c57c406a8 h1:kW3UF3RTC0FfSEnZ5bYoLXzSt3nL2ZL7OGGBGcGMqLI=
|
||||
github.com/owncloud/reva-phoenix v0.0.0-20190821135724-6aebb11b7574 h1:7B+vQUtltjUayyhKEi60MHRZF8Aoog8y23iFKIwfxGQ=
|
||||
github.com/owncloud/reva-phoenix v0.0.0-20190821135724-6aebb11b7574/go.mod h1:eLLmZJn/oucdRh8Q6yYgljf8BsK/Uts7XEbx53qm1Qs=
|
||||
github.com/owncloud/reva-phoenix v0.0.0-20190821140025-f7b3b4dcbb28 h1:X9nTgC0g/00os8CHEQod4WIdyzxqWLnWCy/+MiTvuqA=
|
||||
github.com/owncloud/reva-phoenix v0.0.0-20190821140025-f7b3b4dcbb28/go.mod h1:eLLmZJn/oucdRh8Q6yYgljf8BsK/Uts7XEbx53qm1Qs=
|
||||
github.com/owncloud/reva-phoenix v0.0.0-20190821144117-6ad779051ca6 h1:dIJDU+tcrciYAdfYoCbs0uA/rlOkzjIGjoYTWqN/F9M=
|
||||
github.com/owncloud/reva-phoenix v0.0.0-20190821144117-6ad779051ca6/go.mod h1:eLLmZJn/oucdRh8Q6yYgljf8BsK/Uts7XEbx53qm1Qs=
|
||||
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
||||
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||
github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s=
|
||||
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
|
||||
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
||||
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
|
||||
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
|
||||
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
||||
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
64
main.go
Normal file
64
main.go
Normal file
@@ -0,0 +1,64 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
revaphoenix "github.com/owncloud/reva-phoenix/service"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
revahyperCommand, allCommandFns := NewRevahHyperCommand()
|
||||
|
||||
basename := filepath.Base(os.Args[0])
|
||||
if err := commandFor(basename, revahyperCommand, allCommandFns).Execute(); err != nil {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
// NewRevahHyperCommand is the entry point for reva-hyper
|
||||
func NewRevahHyperCommand() (*cobra.Command, []func() *cobra.Command) {
|
||||
|
||||
apiserver := func() *cobra.Command { return revaphoenix.NewRevaPhoenixCommand("phoenix") }
|
||||
|
||||
commandFns := []func() *cobra.Command{
|
||||
apiserver,
|
||||
}
|
||||
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "reva-hyper",
|
||||
Short: "Manage oCIS stack",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if len(args) != 0 {
|
||||
cmd.Help()
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
for i := range commandFns {
|
||||
cmd.AddCommand(commandFns[i]())
|
||||
}
|
||||
|
||||
return cmd, commandFns
|
||||
}
|
||||
|
||||
func commandFor(basename string, defaultCommand *cobra.Command, commands []func() *cobra.Command) *cobra.Command {
|
||||
for _, commandFn := range commands {
|
||||
command := commandFn()
|
||||
if command.Name() == basename {
|
||||
return command
|
||||
}
|
||||
for _, alias := range command.Aliases {
|
||||
if alias == basename {
|
||||
return command
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return defaultCommand
|
||||
}
|
||||
Reference in New Issue
Block a user