Created
May 25, 2016 12:49
-
-
Save csmith0651/8bd56b8327bb730b78bac5d7cafdb77f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type fileFetcher struct { | |
data []byte | |
file string | |
} | |
func NewFileFetcher(filename string) (S3Fetcher, error) { | |
// read contents of file | |
jsonBuff, err := ioutil.ReadFile(filename) | |
if err != nil { | |
return nil, err | |
} | |
// Create a S3Fetcher object and inject the jsonBuff inside a reader regardless of what S3 object is requested | |
ret := &fileFetcher{ | |
data: jsonBuff, | |
file: filename, | |
} | |
return ret, nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment