Add doc comments for two methods

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
This commit is contained in:
Jonathon Anderson
2023-04-16 07:24:14 -06:00
parent 2319906d97
commit cc714008ef
2 changed files with 7 additions and 1 deletions

View File

@@ -48,7 +48,7 @@ func init() {
}
/*
Creates a new nodeDb object from the actual configuration
Creates a new nodeDb object from the on-disk configuration
*/
func New() (NodeYaml, error) {
wwlog.Verbose("Opening node configuration file: %s", ConfigFile)
@@ -60,6 +60,10 @@ func New() (NodeYaml, error) {
}
// Parse constructs a new nodeDb object from an input YAML
// document. Passes any errors return from yaml.Unmarshal. Returns an
// error if any parsed value is not of a valid type for the given
// parameter.
func Parse(data []byte) (NodeYaml, error) {
var ret NodeYaml
var err error

View File

@@ -135,6 +135,8 @@ func (config *NodeYaml) Persist() error {
}
// Dump returns a YAML document representing the nodeDb
// instance. Passes through any errors generated by yaml.Marshal.
func (config *NodeYaml) Dump() ([]byte, error) {
// flatten out profiles and nodes
for _, val := range config.NodeProfiles {