forked from
tangled.org/core
Monorepo for Tangled — https://tangled.org
1package models
2
3import (
4 "encoding/json"
5 "time"
6)
7
8type PublicKey struct {
9 Did string `json:"did"`
10 Key string `json:"key"`
11 Name string `json:"name"`
12 Rkey string `json:"rkey"`
13 Created *time.Time
14}
15
16func (p PublicKey) MarshalJSON() ([]byte, error) {
17 type Alias PublicKey
18 return json.Marshal(&struct {
19 Created string `json:"created"`
20 *Alias
21 }{
22 Created: p.Created.Format(time.RFC3339),
23 Alias: (*Alias)(&p),
24 })
25}