models

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Note

type Note struct {
	Id        utils.NoteId `json:"id"`
	Headline  string       `json:"headline"`
	Content   string       `json:"content"`
	Tags      []string     `json:"tags"`
	CreatedAt string       `json:"created_at"`
	UpdatedAt string       `json:"updated_at"`
}

func NewNote

func NewNote(noteId utils.NoteId, headline, content string, tags []string) *Note

NewNote creates a new Note instance with the current timestamp and a generated ID.

func (*Note) FromJson

func (n *Note) FromJson(data []byte) error

func (*Note) GetContent

func (n *Note) GetContent() string

func (*Note) GetCreatedAt

func (n *Note) GetCreatedAt() string

func (*Note) GetHeadline

func (n *Note) GetHeadline() string

func (*Note) GetId

func (n *Note) GetId() utils.NoteId

func (*Note) GetTags

func (n *Note) GetTags() []string

func (*Note) GetUpdatedAt

func (n *Note) GetUpdatedAt() string

func (*Note) SetContent

func (n *Note) SetContent(content string)

func (*Note) SetHeadline

func (n *Note) SetHeadline(headline string)

func (*Note) SetTags

func (n *Note) SetTags(tags []string)

func (*Note) SetUpdatedAt

func (n *Note) SetUpdatedAt(updatedAt string)

func (*Note) ToJson

func (n *Note) ToJson() ([]byte, error)

MarshalJSON serializes the Note instance to JSON format.

Jump to

Keyboard shortcuts

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