Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RollbackToVersion ¶
func RollbackToVersion(metadataColl *mongo.Collection, historyColl *mongo.Collection, docID primitive.ObjectID, version int32) error
RollbackToVersion 回滚数据到指定版本
Types ¶
type EmbedLoader ¶
func (*EmbedLoader) Exists ¶
func (el *EmbedLoader) Exists() bool
func (*EmbedLoader) Load ¶
func (el *EmbedLoader) Load() ([]byte, error)
type Manager ¶
type Manager struct { Embed *EmbedLoader Mongo *MongoLoader Yaml *YamlLoader }
type MongoLoader ¶
type MongoLoader struct { Client *mongo.Client MetadataCollection string HistoryCollection string Database string Version string }
func (*MongoLoader) Exists ¶
func (ml *MongoLoader) Exists() bool
func (*MongoLoader) GetCurrentVersion ¶
func (ml *MongoLoader) GetCurrentVersion() (string, error)
GetCurrentVersion 查询当前版本
func (*MongoLoader) GetHistoryVersions ¶
func (ml *MongoLoader) GetHistoryVersions() ([]History, error)
GetHistoryVersions 获取历史版本信息
type YamlLoader ¶
type YamlLoader struct {
Filename string
}
func (*YamlLoader) Exists ¶
func (yl *YamlLoader) Exists() bool
func (*YamlLoader) Load ¶
func (yl *YamlLoader) Load() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.