Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Default = NewRegistry()
Default is the registry with built-in sources registered.
Functions ¶
This section is empty.
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry maps kind identifiers to factory functions. Built-ins are registered in init(); external code can register additional kinds before invoking the validate command.
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) Kinds ¶
Kinds returns the registered kind identifiers in sorted order, for use in help text and error messages.
type SliceSource ¶
type SliceSource struct {
// contains filtered or unexported fields
}
SliceSource is a small adapter for tests and for callers that already have keys in memory. Not registered by default.
func NewSliceSource ¶
func NewSliceSource(keys ...string) *SliceSource
func (*SliceSource) Close ¶
func (s *SliceSource) Close() error
func (*SliceSource) Name ¶
func (s *SliceSource) Name() string
func (*SliceSource) Total ¶
func (s *SliceSource) Total() int
type Source ¶
type Source interface {
// Name returns the kind identifier (e.g. "file", "stdin").
Name() string
// Next returns the next key. io.EOF signals end-of-stream.
Next(ctx context.Context) (string, error)
// Total reports an estimate of total keys if known, or 0 if streaming.
Total() int
// Close releases any underlying resources.
Close() error
}
Source produces a stream of keys to validate. Implementations must be safe to call Next() concurrently; the validate pipeline pulls from a single goroutine so concurrency is not strictly required.
Click to show internal directories.
Click to hide internal directories.