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

fix/cleanup api #10

Merged
merged 6 commits into from
Oct 9, 2024
Merged

fix/cleanup api #10

merged 6 commits into from
Oct 9, 2024

Commits on Oct 9, 2024

  1. move writer to config

    - this is public api; consolidate with public config types
    - the emitter is not public, so it sits in its own file
    
    Signed-off-by: mimir-d <[email protected]>
    mimir-d committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    e49ae70 View commit details
    Browse the repository at this point in the history
  2. refactor crate error type

    - add a single error type for most of the api
    
    Signed-off-by: mimir-d <[email protected]>
    mimir-d committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    c705906 View commit details
    Browse the repository at this point in the history
  3. cleanup WriterError; custom writer type

    - remove WriterError because it'll always be a type of io::Error
    - add WriterType::Custom so that we can write a test checking an actual
      error return from an api call (missing before this commit)
    
    Signed-off-by: mimir-d <[email protected]>
    mimir-d committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    57f7673 View commit details
    Browse the repository at this point in the history
  4. explicitly present public crate api

    Signed-off-by: mimir-d <[email protected]>
    mimir-d committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    9a6bee9 View commit details
    Browse the repository at this point in the history
  5. end methods should consume self

    - this change disallows usage of contextual objects after emitting their
      end artifact, at compile time
    - previously a user could have emitted, for example, a step log after a
      step end
    
    Signed-off-by: mimir-d <[email protected]>
    mimir-d committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    13912a9 View commit details
    Browse the repository at this point in the history
  6. make create api methods naming consistent

    - some methods had a verb, some didnt; add a verb to all the public api
      methods for consistency (also matches the python api more)
    - another reason for this is that the verb allows for backward/future
      compat in the api (eg. `add_step` could turn into `start_step`, with the
      semantic of also starting the step, not just creating it; all while
      being able to keep the previous `add_step` name. if the method was
      called just `step`, this wouldnt be possible)
    
    Signed-off-by: mimir-d <[email protected]>
    mimir-d committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    71bcce6 View commit details
    Browse the repository at this point in the history