Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigValidators ¶
func DefaultConfigValidators() map[string]ConfigValidator
DefaultConfigValidators 返回内建 Provider 的配置校验器。
func DefaultFactories ¶
DefaultFactories returns built-in provider factories keyed by ProviderConfig.Kind.
Types ¶
type BaiduError ¶
BaiduError represents errors returned by Baidu OCR API.
func (*BaiduError) Error ¶
func (e *BaiduError) Error() string
func (*BaiduError) ErrorCategory ¶
func (e *BaiduError) ErrorCategory() string
type ConfigValidator ¶
type ConfigValidator func(*config.ProviderConfig) error
ConfigValidator 用于在构建 Provider 前补全和校验配置。
type ErrorCategorizer ¶
type ErrorCategorizer interface {
ErrorCategory() string
}
TextInError 表示 TextIn API 返回的错误。
type Factory ¶
type Factory func(config.ProviderConfig) (Provider, error)
Factory constructs providers from configuration.
type Provider ¶
Provider defines the contract for upstream OCR services.
func NewBaiduProvider ¶
func NewBaiduProvider(cfg config.ProviderConfig) (Provider, error)
NewBaiduProvider constructs a Baidu OCR provider.
func NewTextInProvider ¶
func NewTextInProvider(cfg config.ProviderConfig) (Provider, error)
NewTextInProvider constructs a TextIn OCR provider.
func NewVolcEngineProvider ¶
func NewVolcEngineProvider(cfg config.ProviderConfig) (Provider, error)
NewVolcEngineProvider 构造火山引擎 OCR Provider。
type TextInError ¶
TextInError 表示 TextIn API 返回的错误。
func (*TextInError) Error ¶
func (e *TextInError) Error() string
func (*TextInError) ErrorCategory ¶
func (e *TextInError) ErrorCategory() string
ErrorCategory 实现 ErrorCategorizer,用于归类 provider 错误。
Click to show internal directories.
Click to hide internal directories.