Documentation ¶
Index ¶
Constants ¶
View Source
const ( Ec2RunningStatus = "Running" Ec2StoppedStatus = "Stopped" )
Variables ¶
View Source
var MonitorPlexCmd = &cobra.Command{ Use: "monitor", Short: "To Monitor Plex Sessions", Long: "to monitor plex sessions and shut it down if no activity.", Run: func(cmd *cobra.Command, args []string) { enabledLambdaMonitor, err := strconv.ParseBool(monitorEnabled) if err == nil && enabledLambdaMonitor { EnabledMonitorRule() os.Exit(0) } else if err == nil && !enabledLambdaMonitor { DisabledMonitorRule() os.Exit(0) } else { Monitor(slackNotification) } }, }
View Source
var (
RootPlexCmd = &cobra.Command{
Use: "plex",
Short: "To Control Plex Media Server",
}
)
View Source
var StartPlexCmd = &cobra.Command{ Use: "start", Short: "To Start Plex", Long: "to start the Plex Media Server.", Run: func(cmd *cobra.Command, args []string) { shutdownCh := make(chan struct{}) go Indicator(shutdownCh) Start() close(shutdownCh) m := make(map[string]string) m["plex_status"] = "started" jsonString, _ := json.Marshal(m) fmt.Println("\n" + string(jsonString)) }, }
View Source
var StatusPlexCmd = &cobra.Command{ Use: "status", Short: "To Get Plex Status", Long: "to get the status of the Plex Media Server.", Run: func(cmd *cobra.Command, args []string) { status := Status() m := make(map[string]interface{}) m["plex_status"] = status jsonString, _ := json.Marshal(m) fmt.Println(strings.ToLower(string(jsonString))) }, }
View Source
var StopPlexCmd = &cobra.Command{ Use: "stop", Short: "To Stop Plex", Long: "to stop the Plex Media Server.", Run: func(cmd *cobra.Command, args []string) { shutdownCh := make(chan struct{}) go Indicator(shutdownCh) Stop(slackNotification) close(shutdownCh) m := make(map[string]string) m["plex_status"] = "stopped" jsonString, _ := json.Marshal(m) fmt.Println("\n" + string(jsonString)) }, }
Functions ¶
func DisabledMonitorRule ¶
func DisabledMonitorRule()
func EnabledMonitorRule ¶
func EnabledMonitorRule()
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.