-
Notifications
You must be signed in to change notification settings - Fork 3
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
Make an importable go package #8
Comments
Hi, I think it would be a good idea to do that. I don't have any time to work on that but if you are willing to do it I can do some review and help to create an official package. |
thanks for your proposition, I would like to give it a try! How do you want me to proceed? My repo is currently living at sr.ht: https://git.sr.ht/~oliverpool/go-moolticute I can move it to github if you prefer (as previously stated, I think it would be great to put it under the For instance, the func McSetKeys(keys *McBinKeys) error {
var buffer bytes.Buffer
if err := gob.NewEncoder(&buffer).Encode(keys); err != nil {
return fmt.Errorf("could not encode with encoding/gob: %v", err)
}
resp, err := moolticute.MakeRequest(*mcUrl, "set_data_node", moolticute.Data{
Service: "Moolticute SSH Keys",
NodeData: base64.StdEncoding.EncodeToString(buffer.Bytes()),
}, moolticute.HandleOtherMsg(printProgressForMoolticute))
if err != nil {
return fmt.Errorf("could not set data: %#v %w", resp, err)
}
return nil
} Edit: I mentionned "this repo" instead of the |
Bonsoir,
thanks for your work on this, I adapted your code to try to be simpler and more idiomatic go.
I made the following modifications:
https://git.sr.ht/~oliverpool/go-moolticute (doc: https://pkg.go.dev/git.sr.ht/~oliverpool/go-moolticute)
Your CLI tools do much more, but I think it would be nice for the ecosystem to have an importable library.
Do you think it would be a good move to have an official
github.com/mooltipass/go-moolticute
package, which could be imported by many other tools? (mc-cli
,mc-get
, ...)This could also be a good opportunity to add some documentation reference (see mooltipass/moolticute#934 ;)
I would be willing to help this effort if you want.
The text was updated successfully, but these errors were encountered: