mirror of
https://github.com/quexten/goldwarden.git
synced 2024-12-18 08:02:10 +03:00
32 lines
695 B
Go
32 lines
695 B
Go
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{})
|
|
}
|