Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add die feed/release methods for json/yaml #98

Merged
merged 1 commit into from
Mar 6, 2023
Merged

Add die feed/release methods for json/yaml #98

merged 1 commit into from
Mar 6, 2023

Conversation

scothis
Copy link
Collaborator

@scothis scothis commented Mar 5, 2023

Errors now result in a panic rather than being ignored.

New die methods:

// DieFeedJSON returns a new die with the provided JSON. Panics on error.
DieFeedJSON(j []byte) *MyResourceDie

// DieFeedYAML returns a new die with the provided YAML. Panics on error.
DieFeedYAML(y []byte) *MyResourceDie

// DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error.
DieFeedYAMLFile(name string) *MyResourceDie

// DieReleaseJSON returns the resource managed by the die as JSON. Panics on error.
DieReleaseJSON() []byte

// DieReleaseYAML returns the resource managed by the die as YAML. Panics on error.
DieReleaseYAML() []byte

Errors now result in a panic rather than being ignored.

New methods:

    // DieFeedJSON returns a new die with the provided JSON. Panics on error.
    DieFeedJSON(j []byte) *MyResourceDie

    // DieFeedYAML returns a new die with the provided YAML. Panics on error.
    DieFeedYAML(y []byte) *MyResourceDie

    // DieFeedYAMLFile returns a new die loading YAML from a file path. Panics on error.
    DieFeedYAMLFile(name string) *MyResourceDie

    // DieReleaseJSON returns the resource managed by the die as JSON. Panics on error.
    DieReleaseJSON() []byte

    // DieReleaseYAML returns the resource managed by the die as YAML. Panics on error.
    DieReleaseYAML() []byte

Signed-off-by: Scott Andrews <[email protected]>
@codecov
Copy link

codecov bot commented Mar 5, 2023

Codecov Report

Merging #98 (9f578e3) into main (73ae377) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #98   +/-   ##
=======================================
  Coverage   10.31%   10.31%           
=======================================
  Files          64       64           
  Lines        3102     3102           
=======================================
  Hits          320      320           
  Misses       2780     2780           
  Partials        2        2           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@scothis scothis merged commit 21dd0e2 into main Mar 6, 2023
@scothis scothis deleted the yaml branch March 6, 2023 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant