SHARE
TWEET

Untitled

a guest Aug 22nd, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func (p *PostElastic) FindById(id string) (*esapi.Response, error) {
  2.     req := esapi.GetRequest{Index: p.post.GetIndexName(), DocumentID: id}
  3.  
  4.     res, err := req.Do(context.Background(), &p.Client)
  5.  
  6.     if err != nil {
  7.         return nil, err
  8.     }
  9.  
  10.     if res.IsError() {
  11.         panic(res.Status())
  12.     }
  13.  
  14.     return res, nil
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top