goldwarden-vaultwarden-bitw.../ipc/messages/getclicredentials.go

32 lines
695 B
Go
Raw Normal View History

2023-09-20 03:05:44 +02:00
package messages
import "encoding/json"
type GetCLICredentialsRequest struct {
ApplicationName string
}
type GetCLICredentialsResponse struct {
Env map[string]string
}
func init() {
registerPayloadParser(func(payload []byte) (interface{}, error) {
var req GetCLICredentialsRequest
err := json.Unmarshal(payload, &req)
if err != nil {
panic("Unmarshal: " + err.Error())
}
return req, nil
}, GetCLICredentialsRequest{})
registerPayloadParser(func(payload []byte) (interface{}, error) {
var req GetCLICredentialsResponse
err := json.Unmarshal(payload, &req)
if err != nil {
panic("Unmarshal: " + err.Error())
}
return req, nil
}, GetCLICredentialsResponse{})
}