internal

package
v0.0.0-...-e5c9662 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const APP_NAME = "liary"

Variables

This section is empty.

Functions

func DayPath

func DayPath(targetTime time.Time, dirPath string) string

func DiaryPath

func DiaryPath(targetTime time.Time, dirPath string, suffix string) (string, error)

func FilterMarkdown

func FilterMarkdown(files []string) []string

func GetAppendValue

func GetAppendValue(args []string) (string, error)

func GetDateRange

func GetDateRange(start time.Time, end time.Time) []time.Time

func GetDiaryList

func GetDiaryList(diaryDirPath string, isAll bool, isFullPath bool, dateRangeString string) ([]string, error)

func GetTargetTime

func GetTargetTime(date string, before, after int) (time.Time, error)

func GetWeakDays

func GetWeakDays(date time.Time) []time.Time

func GrepFiles

func GrepFiles(command, pattern string, files ...string) error

func IsFileExist

func IsFileExist(fPath string) bool

func MakeDir

func MakeDir(dPath string) error

func MakeFile

func MakeFile(fPath string) error

func MonthPath

func MonthPath(targetTime time.Time, dirPath string) string

func OpenEditor

func OpenEditor(program string, args ...string) error

func ParseDate

func ParseDate(s string) (int, int, int, error)

func UpDonwDate

func UpDonwDate(now time.Time, before, after int) (time.Time, error)

func Walk

func Walk(dir string) []string

func YearPath

func YearPath(targetTime time.Time, dirPath string) string

Types

type Config

type Config struct {
	DiaryDir      string            `yaml:"diarydir"`
	Editor        string            `yaml:"editor"`
	EditorOptions []string          `yaml:"editoroptions"`
	WorkSpaces    map[string]string `yaml:"workspaces"`
	GrepCmd       string            `yaml:"grepcmd"`
}

func GetConfig

func GetConfig() (*Config, error)

func (*Config) GetWorkSpace

func (c *Config) GetWorkSpace(name string) (string, error)

func (*Config) Load

func (c *Config) Load() error

func (*Config) Path

func (c *Config) Path() string

func (*Config) Read

func (c *Config) Read() (string, error)

func (*Config) Save

func (c *Config) Save() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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