utils

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyContent = errors.New("content cannot be empty")

ErrEmptyHeadlineAndContent is returned when content is empty

View Source
var ErrNoteCreationFailed = errors.New("note creation failed")

ErrNoteCreationFailed is returned when note creation fails

View Source
var ErrNoteDeletionFailed = errors.New("note deletion failed")

ErrNoteDeletionFailed is returned when note deletion fails

View Source
var ErrNoteIdRequired = errors.New("note ID is required")

ErrNoteIdRequired is returned when a note ID is required but not provided

View Source
var ErrNoteNotFound = errors.New("note not found")

ErrNoteNotFound is returned when a note with the specified ID does not exist

View Source
var ErrNoteUpdateFailed = errors.New("note update failed")

ErrNoteUpdateFailed is returned when note update fails

Functions

func Btoi

func Btoi(b []byte) uint64

func GetCurrentTimestamp

func GetCurrentTimestamp() string

func Itob

func Itob(v NoteId) []byte

func StringInSlice

func StringInSlice(str string, slice []string) bool

func TruncateString

func TruncateString(s string, length int) string

TruncateString truncates a string to a specified length and appends "..." if truncated.

Types

type NoteId

type NoteId uint64

func Stoi

func Stoi(s string) (NoteId, error)

func (NoteId) String

func (n NoteId) String() string

Jump to

Keyboard shortcuts

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