-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simple Ocis Binary
- Loading branch information
Showing
13 changed files
with
265 additions
and
162 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
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,3 +1,5 @@ | ||
// +build !simple | ||
|
||
package command | ||
|
||
import ( | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// +build simple | ||
|
||
package command | ||
|
||
import ( | ||
|
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,3 +1,5 @@ | ||
// +build !simple | ||
|
||
package command | ||
|
||
import ( | ||
|
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,3 +1,5 @@ | ||
// +build !simple | ||
|
||
package command | ||
|
||
import ( | ||
|
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,61 @@ | ||
// +build simple | ||
|
||
package command | ||
|
||
import ( | ||
"strings" | ||
|
||
"github.com/micro/cli" | ||
"github.com/micro/go-micro/config/cmd" | ||
"github.com/owncloud/ocis/pkg/config" | ||
"github.com/owncloud/ocis/pkg/flagset" | ||
"github.com/owncloud/ocis/pkg/micro/runtime" | ||
"github.com/owncloud/ocis/pkg/register" | ||
"github.com/owncloud/ocis/pkg/tracing" | ||
) | ||
|
||
var ( | ||
// SimpleRuntimeServices declares which services will be started for the fullstack server | ||
SimpleRuntimeServices = []string{"hello", "konnectd", "phoenix"} | ||
) | ||
|
||
// Simple is the entrypoint for the server command. It is the `ocis server` subcommand overloaded with a different set of services | ||
func Simple(cfg *config.Config) cli.Command { | ||
return cli.Command{ | ||
Name: "server", | ||
Usage: "Start fullstack server", | ||
Category: "Fullstack", | ||
Flags: flagset.ServerWithConfig(cfg), | ||
Before: func(c *cli.Context) error { | ||
if cfg.HTTP.Root != "/" { | ||
cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/") | ||
} | ||
|
||
return nil | ||
}, | ||
Action: func(c *cli.Context) error { | ||
logger := NewLogger(cfg) | ||
|
||
if err := tracing.Start(cfg); err != nil { | ||
return err | ||
} | ||
|
||
runtime := runtime.New( | ||
runtime.Logger(logger), | ||
runtime.Services(append(runtime.RuntimeServices, SimpleRuntimeServices...)), | ||
runtime.MicroRuntime(cmd.DefaultCmd.Options().Runtime), | ||
) | ||
|
||
{ | ||
runtime.Start() | ||
runtime.Trap() | ||
} | ||
|
||
return nil | ||
}, | ||
} | ||
} | ||
|
||
func init() { | ||
register.AddCommand(Simple) | ||
} |
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,3 +1,5 @@ | ||
// +build !simple | ||
|
||
package command | ||
|
||
import ( | ||
|
Oops, something went wrong.