utils

package
v0.0.0-...-a0bc180 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoverFilesAndDirs

func DiscoverFilesAndDirs(path string, storage *[]Storage) error

Function to get the dirs and files inside a dir

func DiscoverFilesAndDirsRecur

func DiscoverFilesAndDirsRecur(path string, storage *[]Storage)

Function to get every dir and file recursv

func IndexHandle

func IndexHandle(baseTemplate *template.Template) http.HandlerFunc

Handles "/"

func KbHandle

func KbHandle(rootDir string, kb *Kb, someTemplate *template.Template, notesTemplate *template.Template) http.HandlerFunc

Handles "/options" TODO: validate .Execute errors

func MdToHtml

func MdToHtml(file string) (string, error)

Function that transforms .md syntax to .html

Types

type Kb

type Kb struct {
	Title string
	Notes []Storage
}

Struct that represents a webpage with buttons

type Note

type Note struct {
	Title   string
	Content template.HTML
}

Struct that represents a Note

type Page

type Page struct {
	Title string
}

Struct that represents a webpage

type Storage

type Storage struct {
	Type     string
	FullPath string
	Name     string
	Color    string
}

Struct that stores Files and Folders paths

Jump to

Keyboard shortcuts

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