MCPcopy Index your code
hub / github.com/coder/coder / NewAgent

Function NewAgent

tailnet/test/peer.go:75–78  ·  view source on GitHub ↗

NewAgent is a wrapper around NewPeer, creating a peer with Agent auth tied to its ID

(ctx context.Context, t testing.TB, coord tailnet.CoordinatorV2, name string)

Source from the content-addressed store, hash-verified

73
74// NewAgent is a wrapper around NewPeer, creating a peer with Agent auth tied to its ID
75func NewAgent(ctx context.Context, t testing.TB, coord tailnet.CoordinatorV2, name string) *Peer {
76 id := uuid.New()
77 return NewPeer(ctx, t, coord, name, WithID(id), WithAuth(tailnet.AgentCoordinateeAuth{ID: id}))
78}
79
80// NewClient is a wrapper around NewPeer, creating a peer with Client auth tied to the provided agentID
81func NewClient(ctx context.Context, t testing.TB, coord tailnet.CoordinatorV2, name string, agentID uuid.UUID) *Peer {

Callers 1

TestCoordinatorFunction · 0.92

Calls 4

NewPeerFunction · 0.85
WithIDFunction · 0.85
WithAuthFunction · 0.85
NewMethod · 0.65

Tested by 1

TestCoordinatorFunction · 0.74