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

Method Validate

coderd/wspubsub/wspubsub.go:100–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98)
99
100func (w *WorkspaceEvent) Validate() error {
101 if w.WorkspaceID == uuid.Nil {
102 return xerrors.New("workspaceID must be set")
103 }
104 if w.Kind == "" {
105 return xerrors.New("kind must be set")
106 }
107 if w.Kind == WorkspaceEventKindAgentLifecycleUpdate && w.AgentID == nil {
108 return xerrors.New("agentID must be set for Agent events")
109 }
110 return nil
111}

Callers 1

HandleWorkspaceEventFunction · 0.95

Calls 1

NewMethod · 0.65

Tested by

no test coverage detected