Documentation
¶
Index ¶
- type Filter
- type KeyDiff
- type KeyStatus
- type PageInput
- type Report
- type Service
- func (s *Service) Analyze(ctx context.Context) (Report, error)
- func (s *Service) Page(ctx context.Context, signer *security.RequestStateSigner, project string, ...) (Report, error)
- func (s *Service) Walk(ctx context.Context, filter Filter, visit func(KeyDiff) error) (Report, error)
- func (s *Service) WalkInventory(ctx context.Context, inv locale.Inventory, filter Filter, ...) (Report, error)
- type StatusCounts
- type Summary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶ added in v0.16.0
type Filter struct {
Locales []string `json:"locales,omitzero"`
Namespaces []string `json:"namespaces,omitzero"`
Keys []string `json:"keys,omitzero"`
KeyPrefix string `json:"keyPrefix,omitzero"`
Statuses []KeyStatus `json:"statuses,omitzero"`
}
Filter restricts analysis before validation; summaries describe this scope.
type KeyDiff ¶
type KeyDiff struct {
Locale string `json:"locale"`
Namespace string `json:"namespace"`
Key string `json:"key"`
Status KeyStatus `json:"status"`
SourceValue string `json:"sourceValue,omitzero"`
TargetValue string `json:"targetValue,omitzero"`
SourceHash string `json:"sourceHash,omitzero"`
TranslatedFromHash string `json:"translatedFromHash,omitzero"`
TargetHash string `json:"targetHash,omitzero"`
SourceFilePath string `json:"sourceFilePath,omitzero"`
TargetFilePath string `json:"targetFilePath,omitzero"`
Validation []validate.Issue `json:"validation,omitzero"`
Metadata map[string]string `json:"metadata,omitzero"`
}
KeyDiff describes one source/target key comparison.
type KeyStatus ¶
type KeyStatus string
KeyStatus classifies the relationship between source and target keys.
type PageInput ¶ added in v0.16.0
type PageInput struct {
Filter
pagination.Input
}
PageInput combines analysis filters with paging controls.
type Report ¶
type Report struct {
SourceLocale string `json:"sourceLocale"`
TargetLocales []string `json:"targetLocales"`
Summary Summary `json:"summary"`
Items []KeyDiff `json:"items"`
Warnings []string `json:"warnings,omitzero"`
WarningsTotal int `json:"warningsTotal,omitzero"`
Page *pagination.Metadata `json:"page,omitzero"`
}
Report contains locale diff analysis results.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service analyzes differences between source and target keys.
func NewService ¶
func NewService(locales *locale.Service, stateService *state.Service, validator *validate.Service) *Service
NewService creates a project-scoped analyzer.
func (*Service) Analyze ¶
Analyze is the explicit full-detail path for local exports and internal callers.
func (*Service) Page ¶ added in v0.16.0
func (s *Service) Page(ctx context.Context, signer *security.RequestStateSigner, project string, in PageInput) (Report, error)
Page computes a bounded page; no full-detail result cache is retained.
func (*Service) Walk ¶ added in v0.16.0
func (s *Service) Walk(ctx context.Context, filter Filter, visit func(KeyDiff) error) (Report, error)
Walk visits sorted matching records and aggregates counts without retaining them. Filters are applied before validation. Summary counts describe the filtered scope.
type StatusCounts ¶
type StatusCounts struct {
Current int `json:"current"`
Missing int `json:"missing"`
Stale int `json:"stale"`
Extra int `json:"extra"`
Invalid int `json:"invalid"`
Unknown int `json:"unknown"`
}
StatusCounts counts key statuses for one locale.
type Summary ¶
type Summary struct {
Total int `json:"total"`
Current int `json:"current"`
Missing int `json:"missing"`
Stale int `json:"stale"`
Extra int `json:"extra"`
Invalid int `json:"invalid"`
Unknown int `json:"unknown"`
ByLocale map[string]StatusCounts `json:"byLocale,omitzero"`
}
Summary counts key diff statuses.