notes

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2017 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IDFromContext

func IDFromContext(ctx context.Context) (uuid.UUID, bool)

FromContext reads a note ID from the given Context, if it is set.

func NewContext

func NewContext(ctx context.Context, u Note) context.Context

NewContext creates a new Context including the given Note and returns it.

func NewIDContext

func NewIDContext(ctx context.Context, id uuid.UUID) context.Context

NewContext creates a new Context including the given note ID and returns it.

Types

type Note

type Note struct {
	ID       uuid.UUID `json:"id" xml:"id,attr" bson:"_id"`
	Folder   string    `json:"path" xml:"folder,attr,omitempty" storm:"index"`
	Title    string    `json:"title" xml:"Meta>Title"`
	Owner    uuid.UUID `json:"owner" xml:"Meta>Owner" storm:"index"`
	Created  time.Time `json:"created" xml:"Meta>Created"`
	Modified time.Time `json:"modified" xml:"Meta>Modified" storm:"index"`
	Tags     []string  `json:"tags" xml:"Meta>Tags>Tag,omitempty" storm:"index"`
	Body     string    `json:"body"`
	HTMLBody string    `json:"html" xml:"html"`
}

Note is a specific user-owned document.

func FromContext

func FromContext(ctx context.Context) (Note, bool)

FromContext reads a Note from the given Context, if it is set.

func WelcomeNote

func WelcomeNote(userID uuid.UUID) Note

WelcomeNote creates a new welcome note for the given user.

Jump to

Keyboard shortcuts

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