wiki/storage/interface.go

28 lines
783 B
Go

package storage
type Interface interface {
TermInterface
RevisionInterface
}
type TermInterface interface {
CreateTerm(term *Term) error
UpdateTerm(term *Term) error
RemoveTerm(term *Term) error
GetTermByName(name string) (*Term, error)
GetTermBySlug(slug string) (*Term, error)
GetTermByID(id string) (*Term, error)
GetTerms() ([]*Term, error)
}
type RevisionInterface interface {
CreateRevision(revision *Revision) error
RemoveRevision(revision *Revision) error
RemoveRevisionsByTermID(termID string) error
GetRevisionByTermName(termName string) (*Revision, error)
GetRevisionByTermSlug(termSlug string) (*Revision, error)
GetRevisionByTermID(termID string) (*Revision, error)
GetRevisionByID(id string) (*Revision, error)
GetRevisions() ([]*Revision, error)
}