refactor: optimize driver initialization need to manually deserialize and assign values, and remove redundant driver registration parameters (#2691)

* refactor: optimize driver initialization need to manually deserialize and assign values, and remove redundant driver registration parameters

* fix typo

Co-authored-by: Noah Hsu <i@nn.ci>
This commit is contained in:
foxxorcat
2022-12-13 18:03:30 +08:00
committed by GitHub
parent 3ee45c69a7
commit 33bae52fa1
67 changed files with 194 additions and 392 deletions

View File

@ -17,11 +17,11 @@ type Meta interface {
Config() Config
// GetStorage just get raw storage, no need to implement, because model.Storage have implemented
GetStorage() *model.Storage
// GetAddition Additional can't be modified externally, so needn't return pointer
SetStorage(model.Storage)
// GetAddition Additional is used for unmarshal of JSON, so need return pointer
GetAddition() Additional
// Init If already initialized, drop first
// need to unmarshal string to addition first
Init(ctx context.Context, storage model.Storage) error
Init(ctx context.Context) error
Drop(ctx context.Context) error
}