You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
577 B
Go

package main
import (
"crypto/rand"
)
type GetNoteRequest int
func (g GetNoteRequest) Kind() string {
return "get-note"
}
type Note struct {
Title string
Body []byte
}
type EncryptedNote struct {
Key []byte
Title []byte
Body []byte
}
func (n EncryptedNote) Kind() string {
return "note"
}
func randslice(n int) ([]byte, error) {
b := make([]byte, n)
_, err := rand.Read(b)
if err != nil {
return nil, err
}
return b, nil
}
type ListNotes struct {
N int
}
func (l ListNotes) Kind() string {
return "list-notes"
}
type ListNotesResponse struct {
}