add method to handlers
This commit is contained in:
@@ -10,14 +10,25 @@ import (
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
type MediaType string
|
||||
var (
|
||||
CfgFile string
|
||||
Verbose int
|
||||
Overwrite bool
|
||||
ServerName string
|
||||
Mediatype MediaType
|
||||
Config CliConfig
|
||||
DryRun bool
|
||||
FileName string
|
||||
)
|
||||
|
||||
const (
|
||||
mediaTypeMedia MediaType = "media"
|
||||
mediaTypeVideo MediaType = "video"
|
||||
mediaTypeLofi MediaType = "lofi"
|
||||
mediaTypeLofi MediaType = "lofi"
|
||||
)
|
||||
|
||||
type MediaType string
|
||||
|
||||
func (e *MediaType) String() string {
|
||||
return string(*e)
|
||||
}
|
||||
@@ -37,23 +48,13 @@ func (e *MediaType) Type() string {
|
||||
}
|
||||
|
||||
func myEnumCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
||||
return []string{
|
||||
"media\thelp text for media",
|
||||
"video\thelp text for video",
|
||||
"lofi\thelp text for lofi",
|
||||
}, cobra.ShellCompDirectiveDefault
|
||||
return []string{
|
||||
"media\thelp text for media",
|
||||
"video\thelp text for video",
|
||||
"lofi\thelp text for lofi",
|
||||
}, cobra.ShellCompDirectiveDefault
|
||||
}
|
||||
|
||||
var (
|
||||
CfgFile string
|
||||
Verbose int
|
||||
Overwrite bool
|
||||
ServerName string
|
||||
Mediatype MediaType
|
||||
Config CliConfig
|
||||
DryRun bool
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
Url string `mapstructure:"url"`
|
||||
Username string `mapstructure:"username"`
|
||||
|
||||
Reference in New Issue
Block a user