Documentation
¶
Index ¶
- func OpenDB(path string) (*sql.DB, error)
- type Note
- type Store
- func (s *Store) ClearAll() error
- func (s *Store) CreateNote(id, host, content, author string) (*Note, error)
- func (s *Store) DeleteNote(id string) error
- func (s *Store) ListHosts() ([]string, error)
- func (s *Store) ListNotes(host string, offset, limit int) ([]Note, int, error)
- func (s *Store) LoadAll() ([]Note, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Note ¶
type Note struct {
ID string `json:"id"`
Host string `json:"host"`
Content string `json:"content"`
Author string `json:"author"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
Note represents a per-host operator note.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store provides CRUD operations for notes.
func (*Store) CreateNote ¶
CreateNote inserts a new note.
func (*Store) DeleteNote ¶
DeleteNote deletes a note by ID.
Click to show internal directories.
Click to hide internal directories.