21 lines
573 B
Go
21 lines
573 B
Go
package store
|
|
|
|
import (
|
|
"git.gm6.ru/icewind/seadoc/models"
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type IVersionStorage interface {
|
|
// Document
|
|
CreateDocument(doc *models.Document) error
|
|
GetDocument(id uuid.UUID) (*models.Document, error)
|
|
UpdateLatestVersion(docID, versionID uuid.UUID) error
|
|
CountSinceLastSnapshot(docID uuid.UUID) (int, error)
|
|
|
|
// Version
|
|
CreateVersion(v *models.Version) error
|
|
GetLatestVersion(docID uuid.UUID) (*models.Version, error)
|
|
GetVersionByID(id uuid.UUID) (*models.Version, error)
|
|
GetParentVersion(v *models.Version) (*models.Version, error)
|
|
}
|