include

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Action *log.Logger
	Warn   *log.Logger
	Info   *log.Logger
	Error  *log.Logger
	Fatal  *log.Logger
)
View Source
var Cyan = "\033[34m"
View Source
var HelpString string = `` /* 563-byte string literal not displayed */
View Source
var Magenta = "\033[35m"
View Source
var NtConfigErr error
View Source
var NtNotesErr error
View Source
var NtPath string

loaded by fs

View Source
var NtPathErr error
View Source
var Red = "\033[31m"
View Source
var Reset = "\033[0m"

colors

View Source
var TestMode bool = false

other

View Source
var Yellow = "\033[33m"

Functions

func InsecureInput

func InsecureInput(message string) []byte

func LoadConfig

func LoadConfig(wg *sync.WaitGroup)

func LoadNotebook

func LoadNotebook(wg *sync.WaitGroup)

func ParseDate

func ParseDate(argument string) time.Time

func SecureInput

func SecureInput(message string) []byte

func SetNtDir

func SetNtDir()

func WriteNotebook

func WriteNotebook(notebook Notebook, filename string) error

Types

type Arguments

type Arguments struct {
	Command CommandType

	Flags    []string
	Tags     []string
	Text     string
	NoteIds  []int
	Deadline time.Time
}

func ParseArgs

func ParseArgs(arguments []string) Arguments

type Authentication

type Authentication struct {
	Username []byte
	Password []byte
}

type CommandType

type CommandType int
const (
	None CommandType = iota

	// notebook
	Add
	Tag
	List
	Move
	Tags
	Undo
	Clear
	Server
	Search
	Modify
	Comment

	// server
	Pull
	Push
	Ping
)

type Config

type Config struct {
	Notebook NotebookConfig `toml:"notebook"`
	Server   ServerConfig   `toml:"server"`
}
var DefaultConfig Config = Config{
	Server: ServerConfig{
		Url:  "",
		Port: ":8282",
	},
	Notebook: NotebookConfig{
		Width:       30,
		DateFormats: []string{"2006-01-02T15:04", "2006-01-02", "Jan 02", "2", "Mon"},
		LsDefault:   "--all",
	},
}
var NtConfig Config

type Note

type Note struct {
	Text    string
	Done    bool
	Created time.Time

	Due      time.Time
	Tags     []string
	Comments []string
	Deadline time.Time
}

type Notebook

type Notebook struct {
	Notes []*Note `json:"Notebook"`
}
var NtNotes Notebook

type NotebookConfig

type NotebookConfig struct {
	Width       int      `toml:"width"`
	DateFormats []string `toml:"date_format"`
	LsDefault   string   `toml:"ls_default"`
}

type ServerConfig

type ServerConfig struct {
	Url  string `toml:"url"`
	Port string `toml:"port"`
}

Jump to

Keyboard shortcuts

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