Initial commit
This commit is contained in:
29
models/identity.go
Normal file
29
models/identity.go
Normal file
@@ -0,0 +1,29 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user