Documentation
¶
Overview ¶
Package channel provides one synthetic catalog channel for application tests. The channel runs on a local test server, so an application test exercises the real pull path and reaches no public network.
Index ¶
Constants ¶
View Source
const ( // ConfiguredEnvironment names the credential of the eligible provider. A // test sets it to a placeholder that reaches only the local test server. ConfiguredEnvironment = "STARMAP_TEST_CONFIGURED_API_KEY" // AbsentEnvironment names a credential that no test sets. The provider that // needs it must send no request. AbsentEnvironment = "STARMAP_TEST_ABSENT_API_KEY" // ConfiguredProvider is the provider that holds a credential. ConfiguredProvider catalogs.ProviderID = "provider-configured" // UnconfiguredProvider is the provider that holds none. UnconfiguredProvider catalogs.ProviderID = "provider-unconfigured" // ObservedModel is the model slug that the channel and the provider share. ObservedModel = "model-observed" // AuthorID owns the canonical authored model of the channel. AuthorID catalogs.AuthorID = "test-author" // GenerationID names the one generation that the channel publishes. GenerationID = "synthetic-1" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Upstream ¶
type Upstream struct {
// contains filtered or unexported fields
}
Upstream is the local test server that publishes one synthetic channel and answers one provider model request. It is also the source that reads that channel, so a test injects it with runtime.WithSource.
func (*Upstream) ChannelReads ¶
ChannelReads counts the channel reads that the runtime made.
func (*Upstream) Close ¶
func (u *Upstream) Close()
Close stops the local test server. A test calls it to simulate an outage.
func (*Upstream) ModelReads ¶
ModelReads counts the provider model requests that reached the server.
Click to show internal directories.
Click to hide internal directories.