-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature(deploy): support http deployment.
Signed-off-by: liuminjian <liuminjian@chinatelecom.cn>
- Loading branch information
liuminjian
committed
Dec 26, 2023
1 parent
7577836
commit 07fda7a
Showing
80 changed files
with
1,131 additions
and
196 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
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,44 @@ | ||
/* | ||
* Copyright (c) 2023 NetEase Inc. | ||
* | ||
* Licensed 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. | ||
*/ | ||
|
||
/* | ||
* Project: CurveAdm | ||
* Created Date: 2023-12-13 | ||
* Author: liuminjian | ||
*/ | ||
|
||
package daemon | ||
|
||
import ( | ||
"github.com/opencurve/curveadm/cli/cli" | ||
cliutil "github.com/opencurve/curveadm/internal/utils" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func NewDaemonCommand(curveadm *cli.CurveAdm) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "daemon", | ||
Short: "Manage curveadm daemon service", | ||
Args: cliutil.NoArgs, | ||
RunE: cliutil.ShowHelp(curveadm.Err()), | ||
} | ||
|
||
cmd.AddCommand( | ||
NewStartCommand(curveadm), | ||
NewStopCommand(curveadm), | ||
) | ||
return cmd | ||
} |
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,58 @@ | ||
/* | ||
* Copyright (c) 2023 NetEase Inc. | ||
* | ||
* Licensed 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. | ||
*/ | ||
|
||
/* | ||
* Project: CurveAdm | ||
* Created Date: 2023-12-13 | ||
* Author: liuminjian | ||
*/ | ||
|
||
package daemon | ||
|
||
import ( | ||
"github.com/opencurve/curveadm/cli/cli" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
const ( | ||
START_EXAMPLR = `Examples: | ||
$ curveadm daemon start # Start daemon service` | ||
) | ||
|
||
type startOptions struct { | ||
filename string | ||
} | ||
|
||
func NewStartCommand(curveadm *cli.CurveAdm) *cobra.Command { | ||
var options startOptions | ||
pigeon := curveadm.GetPigeon() | ||
|
||
cmd := &cobra.Command{ | ||
Use: "start [OPTIONS]", | ||
Short: "Start daemon service", | ||
Example: START_EXAMPLR, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
return pigeon.Start(options.filename) | ||
}, | ||
DisableFlagsInUseLine: true, | ||
} | ||
|
||
flags := cmd.Flags() | ||
flags.StringVarP(&options.filename, "conf", "c", pigeon.DefaultConfFile(), | ||
"Specify pigeon configure file") | ||
|
||
return cmd | ||
} |
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) 2023 NetEase Inc. | ||
* | ||
* Licensed 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. | ||
*/ | ||
|
||
/* | ||
* Project: CurveAdm | ||
* Created Date: 2023-12-13 | ||
* Author: liuminjian | ||
*/ | ||
|
||
package daemon | ||
|
||
import ( | ||
"github.com/opencurve/curveadm/cli/cli" | ||
cliutil "github.com/opencurve/curveadm/internal/utils" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
const ( | ||
STOP_EXAMPLR = `Examples: | ||
$ curveadm daemon stop # Stop daemon service` | ||
) | ||
|
||
type stopOptions struct { | ||
filename string | ||
} | ||
|
||
func NewStopCommand(curveadm *cli.CurveAdm) *cobra.Command { | ||
var options stopOptions | ||
pigeon := curveadm.GetPigeon() | ||
|
||
cmd := &cobra.Command{ | ||
Use: "stop", | ||
Short: "Stop daemon service", | ||
Args: cliutil.NoArgs, | ||
Example: STOP_EXAMPLR, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
return pigeon.Stop(options.filename) | ||
}, | ||
DisableFlagsInUseLine: true, | ||
} | ||
|
||
flags := cmd.Flags() | ||
flags.StringVarP(&options.filename, "conf", "c", pigeon.DefaultConfFile(), | ||
"Specify pigeon configure file") | ||
|
||
return cmd | ||
} |
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
Oops, something went wrong.