Skip to content
This repository has been archived by the owner on Feb 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #91 from ripienaar/88
Browse files Browse the repository at this point in the history
(#88) add an agent level helper for converting and validating
  • Loading branch information
ripienaar authored Sep 7, 2019
2 parents 213dcbb + 53ecaa6 commit 38323db
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mcorpc/ddl/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,13 @@ func (d *DDL) Timeout() time.Duration {

return time.Duration(time.Second * time.Duration(d.Metadata.Timeout))
}

// ValidateAndConvertToDDLTypes converts args to the correct data types as declared in the DDL and validates everything
func (d *DDL) ValidateAndConvertToDDLTypes(action string, args map[string]string) (result map[string]interface{}, warnings []string, err error) {
acti, err := d.ActionInterface(action)
if err != nil {
return result, warnings, err
}

return acti.ValidateAndConvertToDDLTypes(args)
}

0 comments on commit 38323db

Please sign in to comment.