Exemple #1
0
func ExampleCreate() {
	s3util.DefaultConfig.AccessKey = "...access key..."
	s3util.DefaultConfig.SecretKey = "...secret key..."
	r, _ := os.Open("/dev/stdin")
	w, _ := s3util.Create("https://mybucket.s3.amazonaws.com/log.txt", nil, nil)
	io.Copy(w, r)
	w.Close()
}
Exemple #2
0
func create(s string) (io.WriteCloser, error) {
	if isURL(s) {
		return s3util.Create(s, nil, nil)
	}
	return os.Create(s)
}