func main() { logger := log.NewLogger(false) client := ami.NewService(false, logger) ids := os.Args[1:] images := client.Find(ami.FindFilter{ Ids: ids, }) for _, img := range images { fmt.Println(img.Id, img.CreatedBy, img.CreatedAt) } }
func main() { var ( usr string latest bool ) flag.StringVar(&usr, "created-by", "", "filter for images by the user that created them") flag.BoolVar(&latest, "latest", false, "only show latest") flag.Parse() logger := log.NewLogger(false) client := ami.NewService(false, logger) filter := ami.FindFilter{ CreatedBy: usr, Latest: latest, } for _, image := range client.Find(filter) { fmt.Println(image.Id) } }