feat: provide interface frida.Device #29
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Provide the interface of
frida.Device
. Pretty similar to what was just done withfrida.DeviceManager
electing to only return the interface to the caller.Discussion point:
You may notice I elected to change the implementation over to
DeviceImpl
. I did this so it would preserve the current godoc. In the case of DeviceManager I forgot that unexporting implementation would not allow for godoc parsing. For example you will not find any of the functions on the latest godoc: https://pkg.go.dev/github.com/frida/frida-go@v0.7.0/frida#DeviceManager. You will only find the interface.I would say this leaves two options.
deviceManager
asDeviceManagerImpl
(like how this MR does it).I'm not married too either direction. Number 2 doesn't feel too great from the end user side. Number 1 does expose the struct, but in reality most users would just call the New func and go about their business. However, either I think adding comments with the interface (like number 2) is a nice touch in general and would be nice to do.