MCPcopy Create free account
hub / github.com/dgraph-io/dgraph-benchmarks / readCredentials

Function readCredentials

twitterdata/stream/stream.go:108–123  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

106}
107
108func readCredentials(path string) (*twitterCreds, error) {
109 jsn, err := ioutil.ReadFile(path)
110 if err != nil {
111 log.Printf("Unable to open twitter credentials file '%s' :: %v", path, err)
112 return nil, err
113 }
114
115 var creds twitterCreds
116 err = json.Unmarshal(jsn, &creds)
117 if err != nil {
118 log.Printf("Unable to parse twitter credentials file '%s' :: %v", path, err)
119 return nil, err
120 }
121
122 return &creds, nil
123}
124
125func newTwitterClient(creds *twitterCreds) (*anaconda.TwitterApi, error) {
126 client := anaconda.NewTwitterApiWithCredentials(

Callers 1

mainFunction · 0.85

Calls 1

UnmarshalMethod · 0.45

Tested by

no test coverage detected