Skip to content

Commit

Permalink
prep for rewriting some ops to Go
Browse files Browse the repository at this point in the history
Signed-off-by: Tony Worm <tony@hofstadter.io>
  • Loading branch information
verdverm committed Nov 17, 2021
1 parent 2c51178 commit e0a1bcc
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 0 deletions.
9 changes: 9 additions & 0 deletions structural/extend.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,12 @@ func ExtendGlobsCue(code string, globs []string, rflags flags.RootPflagpole) ([]

return results, nil
}

func ExtendValue(ext, val cue.Value) cue.Value {
r, _ := extendValue(ext, val)
return r
}

func extendValue(ext, val cue.Value) (cue.Value, bool) {
return ext, false
}
9 changes: 9 additions & 0 deletions structural/mask.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,12 @@ func MaskGlobsCue(mask string, globs []string, rflags flags.RootPflagpole) ([]Gl

return results, nil
}

func MaskValue(mask, val cue.Value) cue.Value {
r, _ := maskValue(mask, val)
return r
}

func maskValue(mask, val cue.Value) (cue.Value, bool) {
return mask, false
}
9 changes: 9 additions & 0 deletions structural/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,12 @@ func PatchGlobsCue(patch string, orig string, rflags flags.RootPflagpole) ([]Glo

return results, nil
}

func PatchValue(patch, val cue.Value) cue.Value {
r, _ := patchValue(patch, val)
return r
}

func patchValue(patch, val cue.Value) (cue.Value, bool) {
return val, false
}
9 changes: 9 additions & 0 deletions structural/replace.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,12 @@ func ReplaceGlobsCue(code string, globs []string, rflags flags.RootPflagpole) ([

return results, nil
}

func ReplaceValue(rep, val cue.Value) cue.Value {
r, _ := replaceValue(rep, val)
return r
}

func replaceValue(rep, val cue.Value) (cue.Value, bool) {
return val, false
}
9 changes: 9 additions & 0 deletions structural/upsert.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,12 @@ func UpsertGlobsCue(code string, globs []string, rflags flags.RootPflagpole) ([]

return results, nil
}

func UpsertValue(up, val cue.Value) cue.Value {
r, _ := upsertValue(up, val)
return r
}

func upsertValue(up, val cue.Value) (cue.Value, bool) {
return val, false
}

0 comments on commit e0a1bcc

Please sign in to comment.