mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
17 lines
368 B
Go
17 lines
368 B
Go
package internal
|
|
|
|
import (
|
|
"github.com/portainer/portainer"
|
|
|
|
"encoding/json"
|
|
)
|
|
|
|
// MarshalUser encodes a user to binary format.
|
|
func MarshalUser(user *portainer.User) ([]byte, error) {
|
|
return json.Marshal(user)
|
|
}
|
|
|
|
// UnmarshalUser decodes a user from a binary data.
|
|
func UnmarshalUser(data []byte, user *portainer.User) error {
|
|
return json.Unmarshal(data, user)
|
|
}
|