-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
http plugin is one of the most used plugins together with the shell plugin, embedding it in the main binary allow for more lean deployment.
- Loading branch information
Showing
10 changed files
with
47 additions
and
38 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 was deleted.
Oops, something went wrong.
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,30 @@ | ||
package cmd | ||
|
||
import ( | ||
dkplugin "github.com/distribworks/dkron/v4/plugin" | ||
"github.com/distribworks/dkron/v4/plugin/http" | ||
"github.com/hashicorp/go-plugin" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var httpCmd = &cobra.Command{ | ||
Hidden: true, | ||
Use: "http", | ||
Short: "Run the http plugin", | ||
Long: ``, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
plugin.Serve(&plugin.ServeConfig{ | ||
HandshakeConfig: dkplugin.Handshake, | ||
Plugins: map[string]plugin.Plugin{ | ||
"executor": &dkplugin.ExecutorPlugin{Executor: &http.HTTP{}}, | ||
}, | ||
|
||
// A non-nil value here enables gRPC serving for this plugin... | ||
GRPCServer: plugin.DefaultGRPCServer, | ||
}) | ||
}, | ||
} | ||
|
||
func init() { | ||
dkronCmd.AddCommand(httpCmd) | ||
} |
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,4 +1,4 @@ | ||
package main | ||
package http | ||
|
||
import ( | ||
"bytes" | ||
|
2 changes: 1 addition & 1 deletion
2
...tin/bins/dkron-executor-http/http_test.go → plugin/http/http_test.go
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,4 +1,4 @@ | ||
package main | ||
package http | ||
|
||
import ( | ||
"bytes" | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.