30 lines
381 B
Go
30 lines
381 B
Go
|
package models
|
||
|
|
||
|
import (
|
||
|
"github.com/google/uuid"
|
||
|
)
|
||
|
|
||
|
var (
|
||
|
Me Identity
|
||
|
)
|
||
|
|
||
|
func init() {
|
||
|
Me = Identity{uuid.New().String(), "My name", "My key", "MyUrl"}
|
||
|
}
|
||
|
|
||
|
type Identity struct {
|
||
|
Id string
|
||
|
Name string
|
||
|
PublicKey string
|
||
|
Url string
|
||
|
}
|
||
|
|
||
|
func GetIdentity() (u *Identity) {
|
||
|
return &Me
|
||
|
}
|
||
|
|
||
|
func UpdateIdentity(uu *Identity) (a *Identity) {
|
||
|
Me = *uu
|
||
|
return &Me
|
||
|
}
|