Documentation
¶
Index ¶
- func New(t testing.TB, coderURL *url.URL, agentToken string, ...) agent.Agent
- type Client
- func (c *Client) DERPMapUpdates(_ context.Context) (<-chan agentsdk.DERPMapUpdate, io.Closer, error)
- func (c *Client) GetLifecycleStates() []codersdk.WorkspaceAgentLifecycle
- func (c *Client) GetMetadata() map[string]agentsdk.Metadata
- func (c *Client) GetServiceBanner(ctx context.Context) (codersdk.ServiceBannerConfig, error)
- func (c *Client) GetStartup() agentsdk.PostStartupRequest
- func (c *Client) GetStartupLogs() []agentsdk.Log
- func (c *Client) Listen(_ context.Context) (net.Conn, error)
- func (c *Client) Manifest(_ context.Context) (agentsdk.Manifest, error)
- func (c *Client) PatchLogs(ctx context.Context, logs agentsdk.PatchLogs) error
- func (c *Client) PostAppHealth(ctx context.Context, req agentsdk.PostAppHealthsRequest) error
- func (c *Client) PostLifecycle(ctx context.Context, req agentsdk.PostLifecycleRequest) error
- func (c *Client) PostMetadata(ctx context.Context, req agentsdk.PostMetadataRequest) error
- func (c *Client) PostStartup(ctx context.Context, startup agentsdk.PostStartupRequest) error
- func (c *Client) PushDERPMapUpdate(update agentsdk.DERPMapUpdate) error
- func (c *Client) ReportStats(ctx context.Context, _ slog.Logger, statsChan <-chan *agentsdk.Stats, ...) (io.Closer, error)
- func (c *Client) SetServiceBannerFunc(f func() (codersdk.ServiceBannerConfig, error))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶ added in v2.2.0
func New(t testing.TB, coderURL *url.URL, agentToken string, opts ...func(*agent.Options)) agent.Agent
New starts a new agent for use in tests. The agent will use the provided coder URL and session token. The options passed to agent.New() can be modified by passing an optional variadic func(*agent.Options). Returns the agent. Closing the agent is handled by the test cleanup. It is the responsibility of the caller to call coderdtest.AwaitWorkspaceAgents to ensure agent is connected.
Types ¶
type Client ¶
type Client struct { LastWorkspaceAgent func() PatchWorkspaceLogs func() error GetServiceBannerFunc func() (codersdk.ServiceBannerConfig, error) // contains filtered or unexported fields }
func (*Client) DERPMapUpdates ¶
func (*Client) GetLifecycleStates ¶
func (c *Client) GetLifecycleStates() []codersdk.WorkspaceAgentLifecycle
func (*Client) GetServiceBanner ¶
func (*Client) GetStartup ¶
func (c *Client) GetStartup() agentsdk.PostStartupRequest
func (*Client) GetStartupLogs ¶
func (*Client) PostAppHealth ¶
func (*Client) PostLifecycle ¶
func (*Client) PostMetadata ¶
func (*Client) PostStartup ¶
func (*Client) PushDERPMapUpdate ¶
func (c *Client) PushDERPMapUpdate(update agentsdk.DERPMapUpdate) error
func (*Client) ReportStats ¶
func (*Client) SetServiceBannerFunc ¶
func (c *Client) SetServiceBannerFunc(f func() (codersdk.ServiceBannerConfig, error))
Click to show internal directories.
Click to hide internal directories.