Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RenderCmd = cli.Command{ Name: "render", Usage: "Validate and render a YAML or JSON to sbatch script", Flags: []cli.Flag{ &cli.PathFlag{ Name: "file", Value: "script.yaml", Usage: "File to convert.", Destination: &file, Aliases: []string{"f"}, }, }, Action: func(ctx *cli.Context) error { r := renderer.NewJobRenderer( "logger.example.com:443", "/usr/local/bin/grid-logger-writer", ) bytes, err := os.ReadFile(file) if err != nil { logger.I.Error("failed to read file", zap.Error(err)) return err } j := struct { Job model.Job }{} if err := yaml.Unmarshal(bytes, &j); err != nil { logger.I.Error("failed to parse file", zap.Error(err)) return err } out, err := r.RenderJob(&j.Job) if err != nil { logger.I.Error("failed to render sbatch script from file", zap.Error(err)) return err } fmt.Println(out) return nil }, } )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.