Documentation
¶
Overview ¶
Package plugintest makes what a plugin is given, for the plugin's tests: a job, and a job's channel held in memory.
Index ¶
- func Job(t testing.TB, allow ...string) *plugin.Job
- type Channel
- func (c *Channel) BuildTree(plugin.Tree, map[string][]byte) ([]plugin.TreeProblem, *blob.Ref, error)
- func (c *Channel) Define(string, map[string]string) (blob.Ref, error)
- func (c *Channel) Emit(name string, data any) error
- func (c *Channel) Emitted() []Emitted
- func (c *Channel) Fetched() (fetches int, bytes, largest int64)
- func (c *Channel) Hold(typ string, contents []byte) *plugin.Blob
- func (c *Channel) ReadBlob(ref blob.Ref, from, length int64) ([]byte, error)
- func (c *Channel) Variable(name string) (string, bool, error)
- func (c *Channel) WriteBlob(typ string, size int64, contents io.Reader) (blob.Ref, error)
- type Emitted
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Channel ¶
type Channel struct {
Variables map[string]string
// EmitFails, where it is set, is what each emit gives.
EmitFails error
// contains filtered or unexported fields
}
Channel is a job's channel held in memory. It keeps what was emitted and the blobs written to it, and gives the variables it was given. It defines no machine and builds no tree.
func (*Channel) Fetched ¶
Fetched gives how many reads of a blob were made, the bytes they gave, and the most one read gave.