Documentation ¶
Index ¶
- Constants
- Variables
- func AddFallbackSourceFactory(factory FallbackFactory)
- func AddFallbackTargetFactory(factory FallbackFactory)
- func BuildSourceDoc(typ abstract.ProviderType, title string) string
- func BuildTargetDoc(typ abstract.ProviderType, title string) string
- func Doc(typ abstract.ProviderType, title string) string
- func ProviderType(typ abstract.ProviderType) func(m model.EndpointParams) bool
- func SourceRules(provider abstract.ProviderType, rules map[schema.Type][]string)
- func SupportedTypes() []schema.Type
- func TargetRule(provider abstract.ProviderType, rules map[schema.Type]string)
- type Fallback
- type FallbackFactory
- type Rule
Constants ¶
View Source
const ( RestPlaceholder = "REST..." NotSupportedPlaceholder = "N/A" )
View Source
const LatestVersion int = model.LatestVersion
View Source
const NewTransfersVersion int = model.NewTransfersVersion
Variables ¶
View Source
var FallbackDoesNotApplyErr = xerrors.NewSentinel("this fallback does not apply")
View Source
var SourceFallbackFactories = make([]FallbackFactory, 0)
View Source
var TargetFallbackFactories = make([]FallbackFactory, 0)
Functions ¶
func AddFallbackSourceFactory ¶
func AddFallbackSourceFactory(factory FallbackFactory)
AddFallbackSourceFactory registers a fallbacks for a source of some type
This method is expected to be called in the `init()` function of a module which introduces a fallback when some additional behaviour is expected
func AddFallbackTargetFactory ¶
func AddFallbackTargetFactory(factory FallbackFactory)
AddFallbackTargetFactory registers a fallbacks for a target of some type
This method is expected to be called in the `init()` function of a module which introduces a fallback when some additional behaviour is expected
func BuildSourceDoc ¶
func BuildSourceDoc(typ abstract.ProviderType, title string) string
func BuildTargetDoc ¶
func BuildTargetDoc(typ abstract.ProviderType, title string) string
func ProviderType ¶
func ProviderType(typ abstract.ProviderType) func(m model.EndpointParams) bool
func SourceRules ¶
func SourceRules(provider abstract.ProviderType, rules map[schema.Type][]string)
func SupportedTypes ¶
func TargetRule ¶
func TargetRule(provider abstract.ProviderType, rules map[schema.Type]string)
Types ¶
type Fallback ¶
type Fallback struct { // To is the target typesystem version of this fallback To int // Picker limits the endpoints to which this fallback applies Picker func(m model.EndpointParams) bool // Function defines the transformation. Input is an item of any kind. // // If a fallback does not apply, this method MUST return an error containing FallbackDoesNotApplyErr Function func(ci *abstract.ChangeItem) (*abstract.ChangeItem, error) }
Fallback defines a transformation from a newer version of typesystem to an older one.
type FallbackFactory ¶
type FallbackFactory func() Fallback
type Rule ¶
type Rule struct { // `Target` stores the mapping of `schema.Type`-s to provider-specific types for each `Target` provider. // example: // {schema.TypeString: "TEXT"} Target map[schema.Type]string // `Source` stores the conversion rules from the provider-specific type to the `schema.Type` for each `Source` provider. // example: // {"TINYTEXT": schema.TypeString} Source map[string]schema.Type }
func RuleFor ¶
func RuleFor(provider abstract.ProviderType) Rule
Click to show internal directories.
Click to hide internal directories.