Documentation
¶
Index ¶
Constants ¶
View Source
const (
DefaultOutputFilename = ImageTypeName + ".png"
)
View Source
const ImageTypeName = "blank"
Variables ¶
View Source
var ConfigCmd = &cobra.Command{ Use: "config", Short: "Print a blank config for the " + ImageTypeName + " image type", Run: func(cmd *cobra.Command, args []string) { encoded, _ := json.Marshal(pkg.Config{Color: "white"}) cmd.Println(string(encoded)) }, }
View Source
var GenerateCmd = &cobra.Command{ Use: "generate", Short: "Generates a " + ImageTypeName + " image", PreRunE: parseConfig, RunE: func(cmd *cobra.Command, args []string) error { image := ImageGenerator.GenerateImage(viper.GetInt("width"), viper.GetInt("height")) if viper.GetBool("to-stdout") { return internal.EncodeImage(cmd.OutOrStdout(), image) } else { return internal.WriteImage(viper.GetString("output"), image) } }, }
View Source
var ImageGenerator pkg.ImageGenerator
View Source
var Version = "dev"
View Source
var VersionCmd = &cobra.Command{ Use: "version", Short: "Print the version of this image source", Run: func(cmd *cobra.Command, args []string) { cmd.Printf("%s version: %s\n", ImageTypeName, Version) }, }
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.