Closed ringerc closed 2 years ago
To help others as ignorant of golang as me, you have to import the subpackage from the module explicitly:
$ go get github.com/keybase/go-keychain/secretservice
then
package secretserviceexample
import (
"github.com/keybase/go-keychain/secretservice"
)
func main() {
srv, err := secretservice.NewService()
/* .... */
}
The rest of the API is moderately readable in secretservice/secretservice.go
and the freedesktop spec.
I'll try to find time to add an example to the README soon.
Please add the example - I almost thought there is no Linux support after all when checking the README and doing a quick scan through the Go files in the root.
There's support for the D-Bus based secretservice in the
secretservice/
subdir andsecretservice
package.But as far as I can tell (admittedly as an absolute golang newbie) it doesn't seem to be usable from outside the tests that are the
secretservice
package itself. Should thesecretservice
tests not use a different package and importsecretservice
?Using
then
secretserviceexample.go
:this fails with
There doesn't appear to be anything in the
keychain
package to adapt the secretservice API to the Keychain API such that the mainkeychain
package funcs can be used transparently-ish on Linux. Maybe that was intended but unfinished?