Documentation
¶
Overview ¶
Package sourcetest runs source plugins in-process, for tests on either side of the source protocol: Stub is a source that reports a scripted snapshot, and Launch connects any source to a host over a real go-plugin connection inside the test binary.
Index ¶
- func Launch(t testing.TB, id string, src source.Source, host source.Host) *source.Client
- type Stub
- func (s *Stub) Health(context.Context) (plugin.Health, error)
- func (s *Stub) Host() source.Host
- func (s *Stub) Ingest(ctx context.Context, _ source.IngestRequest) (source.IngestResult, error)
- func (s *Stub) Locate(context.Context, string) (plugin.Unit, bool, error)
- func (s *Stub) Notified() [][]plugin.Unit
- func (s *Stub) Notify(_ context.Context, units []plugin.Unit, _ []plugin.Topic) error
- func (s *Stub) Resolve(context.Context, string) (plugin.Unit, bool, error)
- func (s *Stub) Script(snapshots ...source.Snapshot)
- func (s *Stub) Start(_ context.Context, req source.StartRequest) error
- func (s *Stub) Stop(context.Context) error
- func (s *Stub) Track(_ context.Context, req source.TrackRequest) (source.Tracked, error)
- func (s *Stub) Untrack(context.Context, plugin.Unit) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Stub ¶
type Stub struct {
// contains filtered or unexported fields
}
Stub is a source whose Ingest reports Snapshots to the host. Embed it to add capabilities.
func (*Stub) Ingest ¶
func (s *Stub) Ingest(ctx context.Context, _ source.IngestRequest) (source.IngestResult, error)