Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. package repository
  2.  
  3. import (
  4. "github.com/elastic/go-elasticsearch/esapi"
  5. "go-delic-products/model"
  6. "io"
  7. )
  8.  
  9. type PostsRepo interface {
  10. /**
  11. Return the id of the document indexed
  12. */
  13. Save(post *model.Post) (string, error)
  14.  
  15. /**
  16. In this example, I use the client and return the response from the elastic-go lib
  17. */
  18. FindById(id string) (*esapi.Response, error)
  19.  
  20. /**
  21. Here I use the web client from Go, the query DSL coming from the client - perhaps is no the better idea
  22. but fits OK for an example, cURLs for free.
  23. */
  24. FindByCriteria(criteria io.Reader) (string, error)
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement