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

Method ApplyNetworkSettings

vpn/tunnel.go:201–215  ·  view source on GitHub ↗

ApplyNetworkSettings sends a request to the manager to apply the given network settings

(ctx context.Context, ns *NetworkSettingsRequest)

Source from the content-addressed store, hash-verified

199
200// ApplyNetworkSettings sends a request to the manager to apply the given network settings
201func (t *Tunnel) ApplyNetworkSettings(ctx context.Context, ns *NetworkSettingsRequest) error {
202 msg, err := t.speaker.unaryRPC(ctx, &TunnelMessage{
203 Msg: &TunnelMessage_NetworkSettings{
204 NetworkSettings: ns,
205 },
206 })
207 if err != nil {
208 return xerrors.Errorf("rpc failure: %w", err)
209 }
210 resp := msg.GetNetworkSettings()
211 if !resp.Success {
212 return xerrors.Errorf("network settings failed: %s", resp.ErrorMessage)
213 }
214 return nil
215}
216
217func (t *Tunnel) start(req *StartRequest) error {
218 rawURL := req.GetCoderUrl()

Callers 3

SetMethod · 0.80
SetDNSMethod · 0.80

Calls 3

unaryRPCMethod · 0.80
ErrorfMethod · 0.45
GetNetworkSettingsMethod · 0.45

Tested by 1