Example #1
0
func ExampleOpen() {
	s3util.DefaultConfig.AccessKey = "...access key..."
	s3util.DefaultConfig.SecretKey = "...secret key..."
	r, _ := s3util.Open("https://mybucket.s3.amazonaws.com/log.txt", nil)
	w, _ := os.Create("out.txt")
	io.Copy(w, r)
	w.Close()
}
Example #2
0
File: main.go Project: kevbook/hk
func open(s string) (io.ReadCloser, error) {
	if isURL(s) {
		return s3util.Open(s, nil)
	}
	return os.Open(s)
}