interface.go 783 B

123456789101112131415161718192021222324252627
  1. package storage
  2. type Interface interface {
  3. TermInterface
  4. RevisionInterface
  5. }
  6. type TermInterface interface {
  7. CreateTerm(term *Term) error
  8. UpdateTerm(term *Term) error
  9. RemoveTerm(term *Term) error
  10. GetTermByName(name string) (*Term, error)
  11. GetTermBySlug(slug string) (*Term, error)
  12. GetTermByID(id string) (*Term, error)
  13. GetTerms() ([]*Term, error)
  14. }
  15. type RevisionInterface interface {
  16. CreateRevision(revision *Revision) error
  17. RemoveRevision(revision *Revision) error
  18. RemoveRevisionsByTermID(termID string) error
  19. GetRevisionByTermName(termName string) (*Revision, error)
  20. GetRevisionByTermSlug(termSlug string) (*Revision, error)
  21. GetRevisionByTermID(termID string) (*Revision, error)
  22. GetRevisionByID(id string) (*Revision, error)
  23. GetRevisions() ([]*Revision, error)
  24. }