importare (
"contesto"
"tempo"
"cloud.google.com/go/storage"
)
// searchBucketFiles cerca i file i cui titoli includono la frase data.
funz searchBucketFiles(con io.Writer, stringa bucket, stringa frase) errore {
// bucket :="nome-bucket"
ctx :=contesto.Sfondo()
client, err :=storage.NewClient(ctx)
se erra!=zero {
return fmt.Errorf("storage.NewClient:%v", err)
}
rinviare client.Close()
query :=&storage.Query{Termini:[]string{frase}}
per iter :=client.Bucket(bucket).Objects(ctx, query);; {
attrs, err :=iter.Next()
if err ==iterator.Done {
rottura
}
se erra!=zero {
return fmt.Errorf("iterator.Next:%v", err)
}
fmt.Fprintln(w, attrs.Nome)
}
ritorno zero
}
```
software © www.354353.com