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

Function validWorkspaceSchedule

coderd/workspaces.go:3001–3015  ·  view source on GitHub ↗
(s *string)

Source from the content-addressed store, hash-verified

2999}
3000
3001func validWorkspaceSchedule(s *string) (sql.NullString, error) {
3002 if ptr.NilOrEmpty(s) {
3003 return sql.NullString{}, nil
3004 }
3005
3006 _, err := cron.Weekly(*s)
3007 if err != nil {
3008 return sql.NullString{}, err
3009 }
3010
3011 return sql.NullString{
3012 Valid: true,
3013 String: *s,
3014 }, nil
3015}
3016
3017func (api *API) publishWorkspaceUpdate(ctx context.Context, ownerID uuid.UUID, event wspubsub.WorkspaceEvent) {
3018 err := event.Validate()

Callers 2

createWorkspaceFunction · 0.85
putWorkspaceAutostartMethod · 0.85

Calls 2

NilOrEmptyFunction · 0.92
WeeklyFunction · 0.92

Tested by

no test coverage detected