notes

package
v0.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(nrw NoteReaderWriter) *Client

func (*Client) Create

func (c *Client) Create(n Note) (int, error)

func (*Client) Delete

func (c *Client) Delete(id int) error

func (*Client) GetByID added in v0.0.7

func (c *Client) GetByID(id int) (*Note, error)

func (*Client) GetByTitle added in v0.0.7

func (c *Client) GetByTitle(title string) (*Note, error)

func (*Client) List

func (c *Client) List() ([]Note, error)

func (*Client) Update added in v0.0.8

func (c *Client) Update(id int, n Note) (int64, error)

type Note

type Note struct {
	ID              int    `json:"id,omitempty"`
	Title           string `json:"title,omitempty"`
	Description     string `json:"description,omitempty"`
	CreateTimestamp string `json:"createTimestamp,omitempty"`
}

type NoteReader

type NoteReader interface {
	ListNotes() ([]Note, error)
	GetNoteByID(int) (*Note, error)
	GetNoteByTitle(string) (*Note, error)
}

type NoteReaderWriter

type NoteReaderWriter interface {
	NoteReader
	NoteWriter
}

type NoteWriter

type NoteWriter interface {
	InsertNote(Note) (int, error)
	UpdateNote(int, Note) (int64, error)
	DeleteNote(int) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL