mirror of
https://github.com/ent/ent.git
synced 2026-04-28 05:30:56 +03:00
schema: add merger interface for schema annotations
This commit is contained in:
committed by
Ariel Mashraki
parent
2716f04b1b
commit
49e570b81b
@@ -13,3 +13,12 @@ type Annotation interface {
|
||||
// Name defines the name of the annotation to be retrieved by the codegen.
|
||||
Name() string
|
||||
}
|
||||
|
||||
// Merger wraps the single Merge function allows custom annotation to provide
|
||||
// an implementation for merging 2 or more annotations from the same type.
|
||||
//
|
||||
// A common use case is where the same Annotation type is defined both in
|
||||
// mixin.Schema and ent.Schema.
|
||||
type Merger interface {
|
||||
Merge(Annotation)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user