Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cobra.Command{ Use: "server", Short: "Start plugin server", RunE: func(cmd *cobra.Command, args []string) error { ctx := context.Background() config := ServerConfig{} if err := viper.Unmarshal(&config); err != nil { return err } http.HandleFunc("/api/v1/getparams.execute", config.secretsHandler(ctx)) slog.Info("Server starting...", "listenAddress", config.ListenAddress) if err := http.ListenAndServe(config.ListenAddress, nil); err != nil { slog.Error("Server Failure", "err", err) return err } return nil }, }
Functions ¶
This section is empty.
Types ¶
type PluginInput ¶
type PluginInput struct {
Parameters *PluginParameters `json:"parameters,omitempty"`
}
type PluginParameters ¶
type PluginParameters struct {
LabelSelector metav1.LabelSelector `json:"labelSelector,omitempty"`
}
type ResponseBody ¶
type ResponseBody struct {
Output *ResponseOutput `json:"output,omitempty"`
}
type ResponseOutput ¶
type ResponseOutput struct {
Parameters []*ResponseParameters `json:"parameters,omitempty"`
}
type ResponseParameters ¶
type ResponseParameters struct {
Namespace *string `json:"namespace,omitempty"`
}
type ServerConfig ¶
type ServerConfig struct { ListenAddress string `mapstructure:"listen-address"` ListenToken string `mapstructure:"listen-token"` Local bool `mapstructure:"local"` }
func (*ServerConfig) GetClient ¶
func (c *ServerConfig) GetClient(req *PluginParameters) (kubernetes.Interface, error)
type ServiceRequest ¶
type ServiceRequest struct { ApplicationSetName *string `json:"applicationSetName,omitempty"` Input *PluginInput `json:"input,omitempty"` }
Click to show internal directories.
Click to hide internal directories.