new session.Do API #60

Merged
nemith merged 1 commit from nemith/call_method into main 2023-08-29 05:12:13 +00:00
nemith commented 2023-08-28 15:17:02 +00:00 (Migrated from github.com)

This refactors the Do and it's Reply object.

Do no longer takes a RPCMsg as the only field that isn't overwritten is the request itself. So instead it just take a request.

Reply struct as been renamed from RPCReplyMsg to just Reply to make it a more friendly "first class" object. Methods have been added to it to make it more friendly as well:

  • Decode method wraps xml.Unmarshal for decoding the body
  • Err was added to return the rpc-errors with the severity of error (not warning) as Go errors.

This prompted some other cleanup:

  • NotificationMsg -> Notification
  • RPCMsg was unexported as there really shouldn't be anything that a user need to use directly.
  • The RFC operations msg types were all unexported so they can be used with Do directly if wanted.
  • HelloMsg was unexported.

This is a breaking change, but we are not 1.0 yet.

This refactors the `Do` and it's `Reply` object. `Do` no longer takes a `RPCMsg` as the only field that isn't overwritten is the request itself. So instead it just take a request. `Reply` struct as been renamed from `RPCReplyMsg` to just `Reply` to make it a more friendly "first class" object. Methods have been added to it to make it more friendly as well: * `Decode` method wraps `xml.Unmarshal` for decoding the body * `Err` was added to return the rpc-errors with the severity of `error` (not `warning`) as Go errors. This prompted some other cleanup: * `NotificationMsg` -> ` Notification` * `RPCMsg` was unexported as there really shouldn't be anything that a user need to use directly. * The RFC operations msg types were all unexported so they can be used with `Do` directly if wanted. * HelloMsg was unexported. This is a breaking change, but we are not 1.0 yet.
iazpiazu (Migrated from github.com) approved these changes 2023-08-29 03:05:34 +00:00
Sign in to join this conversation.
No description provided.