note

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2017 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const MaxStringLen = 131070

Always a good idea to have a upper limit

Variables

View Source
var (
	Basic = "basic"
	URL   = "url"

	NoteTypes = []string{
		Basic,
		URL,
	}
)

Note types

Functions

This section is empty.

Types

type Book

type Book struct {
	ID       int64
	Created  time.Time
	Modified time.Time

	Name string
}

Book is a collection of notes

func NewBook

func NewBook() *Book

NewBook returns a new Book

func (*Book) String added in v0.5.0

func (b *Book) String() string

type Books added in v0.5.0

type Books []*Book

func (Books) Len added in v0.5.0

func (b Books) Len() int

func (Books) Less added in v0.5.0

func (b Books) Less(i, j int) bool

func (Books) Swap added in v0.5.0

func (b Books) Swap(i, j int)

type Note

type Note struct {
	ID       int64
	Created  time.Time
	Modified time.Time

	Type  string
	Title string
	Body  string

	Book *Book
	Tags []*Tag
}

Note is our main struct for storing notes and their meta data.

func NewNote

func NewNote() *Note

NewNote returns a new Note

func (*Note) GetTagIDsArray added in v0.5.0

func (n *Note) GetTagIDsArray() []int64

func (*Note) GetTagStringArray

func (n *Note) GetTagStringArray() []string

GetTagStringArray returns a list of the note's tag names

func (*Note) MarshalJSON

func (n *Note) MarshalJSON() ([]byte, error)

MarshalJSON customer json Marshaler

func (*Note) String added in v0.5.0

func (n *Note) String() string

type Notes added in v0.5.0

type Notes []*Note

func (Notes) Len added in v0.5.0

func (n Notes) Len() int

func (Notes) Less added in v0.5.0

func (n Notes) Less(i, j int) bool

func (Notes) Swap added in v0.5.0

func (n Notes) Swap(i, j int)

type Tag

type Tag struct {
	ID       int64
	Created  time.Time
	Modified time.Time

	Name string
}

Tag is a term used as meta data for more accurate searching and labeling.

func NewTag

func NewTag() *Tag

NewTag returns a new Tag

func (*Tag) String added in v0.5.0

func (t *Tag) String() string

type Tags added in v0.5.0

type Tags []*Tag

func (Tags) Len added in v0.5.0

func (t Tags) Len() int

func (Tags) Less added in v0.5.0

func (t Tags) Less(i, j int) bool

func (Tags) Swap added in v0.5.0

func (t Tags) Swap(i, j int)

Jump to

Keyboard shortcuts

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