add web service
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package memos
|
||||
|
||||
import "time"
|
||||
|
||||
// Memo represents a memo from the Memos API.
|
||||
// JSON field names follow protojson camelCase convention.
|
||||
type Memo struct {
|
||||
Name string `json:"name"`
|
||||
State string `json:"state"`
|
||||
Creator string `json:"creator"`
|
||||
CreateTime time.Time `json:"createTime"`
|
||||
UpdateTime time.Time `json:"updateTime"`
|
||||
DisplayTime time.Time `json:"displayTime"`
|
||||
Content string `json:"content"`
|
||||
Visibility string `json:"visibility"`
|
||||
Tags []string `json:"tags"`
|
||||
Pinned bool `json:"pinned"`
|
||||
Snippet string `json:"snippet"`
|
||||
}
|
||||
|
||||
// ListMemosResponse is the response from GET /api/v1/memos.
|
||||
type ListMemosResponse struct {
|
||||
Memos []*Memo `json:"memos"`
|
||||
NextPageToken string `json:"nextPageToken"`
|
||||
}
|
||||
|
||||
func (r *ListMemosResponse) GetMemos() []*Memo {
|
||||
if r == nil {
|
||||
return nil
|
||||
}
|
||||
return r.Memos
|
||||
}
|
||||
Reference in New Issue
Block a user