note

package
v0.0.0-...-eaefaf9 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateNoteRequest

type CreateNoteRequest struct {
	Title    string                 `json:"title"`
	Content  string                 `json:"content"`
	Type     string                 `json:"type"`
	Tags     []string               `json:"tags,omitempty"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

CreateNoteRequest represents the DTO for creating a note

type ListNotesRequest

type ListNotesRequest struct {
	Limit    int      `json:"limit,omitempty"`
	Offset   int      `json:"offset,omitempty"`
	Search   string   `json:"search,omitempty"`
	Tags     []string `json:"tags,omitempty"`
	Type     string   `json:"type,omitempty"`
	OrderBy  string   `json:"order_by,omitempty"`
	OrderDir string   `json:"order_dir,omitempty"`
}

ListNotesRequest represents the DTO for listing notes

type ListNotesResponse

type ListNotesResponse struct {
	Items []Note `json:"items"`
	Total int64  `json:"total"`
}

ListNotesResponse represents the DTO for listing response

type Note

type Note struct {
	ID        int64                  `json:"id"`
	Title     string                 `json:"title"`
	Content   string                 `json:"content"`
	Type      string                 `json:"type"`
	Tags      []string               `json:"tags,omitempty"`
	Metadata  map[string]interface{} `json:"metadata,omitempty"`
	CreatedAt time.Time              `json:"created_at"`
	UpdatedAt time.Time              `json:"updated_at"`
}

Note represents the domain model for a note entity

type NoteType

type NoteType string

NoteType represents the type classification of a note

const (
	NoteTypeText     NoteType = "text"
	NoteTypeMarkdown NoteType = "markdown"
	NoteTypeCode     NoteType = "code"
	NoteTypeLink     NoteType = "link"
	NoteTypeImage    NoteType = "image"
)

type Storage

type Storage interface {
	// Create creates a new note
	Create(ctx context.Context, req CreateNoteRequest) (*Note, error)

	// Get retrieves a note by ID
	Get(ctx context.Context, id int64) (*Note, error)

	// Update updates an existing note
	Update(ctx context.Context, id int64, req UpdateNoteRequest) (*Note, error)

	// Delete deletes a note by ID
	Delete(ctx context.Context, id int64) error

	// List lists notes with pagination and filtering
	List(ctx context.Context, req ListNotesRequest) (*ListNotesResponse, error)
}

Storage defines the interface for note storage operations

type UpdateNoteRequest

type UpdateNoteRequest struct {
	Title    *string                `json:"title,omitempty"`
	Content  *string                `json:"content,omitempty"`
	Type     *string                `json:"type,omitempty"`
	Tags     []string               `json:"tags,omitempty"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

UpdateNoteRequest represents the DTO for updating a note

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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