func (s secretServiceProvider) Delete(service, user string) error {
	svc, err := ss.NewSecretService()
	if err != nil {
		return err
	}
	item, err := s.findItem(svc, service, user)
	if err != nil {
		return err
	}
	return svc.Delete(item)
}
Delete deletes a secret, identified by service & user, from the keyring.
package keyring
import (
	"fmt"
	dbus "github.com/godbus/dbus/v5"
	"github.com/zalando/go-keyring/secret_service"
)
type secretServiceProvider struct{}
func (s secretServiceProvider) Set(service, user, pass string) error {
	svc, err := ss.NewSecretService()
	if err != nil {
		return err
	}
	session, err := svc.OpenSession()
	if err != nil {
		return err
	}
	defer svc.Close(session)
	attributes := map[string]string{
		"username": user,
		"service":  service,
	}
	secret := ss.NewSecret(session.Path(), pass)
	collection := svc.GetLoginCollection()
	err = svc.Unlock(collection.Path())
	if err != nil {
		return err
	}
	err = svc.CreateItem(collection,
		fmt.Sprintf("Password for '%s' on '%s'", user, service),
		attributes, secret)
	if err != nil {
		return err
	}
	return nil
}
func (s secretServiceProvider) findItem(svc *ss.SecretService, service, user string) (dbus.ObjectPath, error) {
	collection := svc.GetLoginCollection()
	search := map[string]string{
		"username": user,
		"service":  service,
	}
	err := svc.Unlock(collection.Path())
	if err != nil {
		return "", err
	}
	results, err := svc.SearchItems(collection, search)
	if err != nil {
		return "", err
	}
	if len(results) == 0 {
		return "", ErrNotFound
	}
	return results[0], nil
}
func (s secretServiceProvider) Get(service, user string) (string, error) {
	svc, err := ss.NewSecretService()
	if err != nil {
		return "", err
	}
	item, err := s.findItem(svc, service, user)
	if err != nil {
		return "", err
	}
	session, err := svc.OpenSession()
	if err != nil {
		return "", err
	}
	defer svc.Close(session)
	secret, err := svc.GetSecret(item, session.Path())
	if err != nil {
		return "", err
	}
	return string(secret.Value), nil
}