data

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMainAlreadyExists  error = errors.New("main set already exists")
	ErrGroupAlreadyExists error = errors.New("group already exists")
	ErrMainSetNotFound    error = errors.New("main set not found")
	ErrTagAlreadyExists   error = errors.New("tag already exists")
	ErrGroupNotFound      error = errors.New("group not found")
	ErrTagNotProvided     error = errors.New("tag not provided")
	ErrInvalidSetType     error = errors.New("invalid set type")
	ErrSetNotFound        error = errors.New("set not found")
)

Functions

This section is empty.

Types

type Box

type Box struct {
	// contains filtered or unexported fields
}

func New

func New() *Box

func (*Box) DeleteGroup added in v0.9.0

func (d *Box) DeleteGroup(name string) error

func (*Box) DeleteGroupWithRelated added in v0.9.0

func (d *Box) DeleteGroupWithRelated(name string) error

func (*Box) DeleteSet

func (d *Box) DeleteSet(key string) error

func (*Box) GetGroups added in v0.9.0

func (d *Box) GetGroups() []string

func (*Box) GetLastKey

func (d *Box) GetLastKey() string

func (*Box) GetMainKey

func (d *Box) GetMainKey() (string, error)

func (*Box) GetSet

func (d *Box) GetSet(key string) (Note, error)

func (*Box) ListAllKeys

func (d *Box) ListAllKeys() []string

func (*Box) ListSetWithHiddenContent

func (d *Box) ListSetWithHiddenContent() []SetViewWithoutContent

func (*Box) ListSets

func (d *Box) ListSets() []SetView

func (*Box) MainAlreadyExists

func (d *Box) MainAlreadyExists() bool

func (*Box) ModifyBox added in v0.0.6

func (d *Box) ModifyBox(box BoxData)

func (*Box) ModifyGroupName added in v0.9.0

func (d *Box) ModifyGroupName(oldName, newName string) error

func (*Box) ModifySetContent added in v0.2.0

func (d *Box) ModifySetContent(key string, content string) error

func (*Box) ModifySetTag

func (d *Box) ModifySetTag(key string, tag string) error

func (*Box) ModifySetType added in v0.8.4

func (d *Box) ModifySetType(key string, sType string) error

func (*Box) NewFromSet

func (d *Box) NewFromSet(set Note) (string, error)

func (*Box) NewGroup added in v0.9.0

func (d *Box) NewGroup(name string) error

func (*Box) NewSet

func (d *Box) NewSet(content, contentType string) (string, error)

func (*Box) NewSetWithTag

func (d *Box) NewSetWithTag(content, contentType, tag string) (string, error)

func (*Box) NewSetsFromOutside

func (d *Box) NewSetsFromOutside(sets []Note) ([]string, error)

func (*Box) OverwriteSet added in v0.2.0

func (d *Box) OverwriteSet(key string, set Note) error

func (*Box) SearchSetByKeyPattern

func (d *Box) SearchSetByKeyPattern(pattern string) (string, Note, error)

func (*Box) SearchSetByKeyTagPattern

func (d *Box) SearchSetByKeyTagPattern(pattern string) (string, Note, error)

func (*Box) TagAlreadyExists

func (d *Box) TagAlreadyExists(tag string) bool

type BoxData

type BoxData struct {
	LastAccess string          `json:"lastSet"`
	NaoSet     map[string]Note `json:"naoSet"`
	Groups     []string        `json:"groups"`
}

func JustLoadBox added in v0.0.6

func JustLoadBox() BoxData

type Changes added in v0.9.0

type Changes struct {
	Content   string    `json:"content"`
	Timestamp time.Time `json:"timestamp"`
}

type Note added in v0.9.0

type Note struct {
	Tag        string    `json:"tag,omitempty"`
	Type       string    `json:"type"`
	Group      string    `json:"group"`
	Content    string    `json:"content"`
	Extension  string    `json:"extension,omitempty"`
	Changes    Changes   `json:"changes"`
	Title      string    `json:"title,omitempty"`
	LastUpdate time.Time `json:"lastUpdate"`
	Version    int       `json:"version"`
}

type SetModifier added in v0.8.4

type SetModifier interface {
	ModifySetContent(key string, content string) error
	ModifySetType(key string, sType string) error
}

type SetView

type SetView struct {
	Tag        string    `json:"tag"`
	Key        string    `json:"key"`
	Type       string    `json:"type"`
	Content    string    `json:"content"`
	Title      string    `json:"title"`
	Extension  string    `json:"extension"`
	LastUpdate time.Time `json:"lastUpdate"`
	Version    int       `json:"version"`
}

type SetViewWithoutContent

type SetViewWithoutContent struct {
	Tag        string    `json:"tag"`
	Key        string    `json:"key"`
	Title      string    `json:"title"`
	Type       string    `json:"type"`
	Extension  string    `json:"extension"`
	LastUpdate time.Time `json:"lastUpdate"`
	Version    int       `json:"version"`
}

type Window

type Window struct {
	Hash       string
	Tag        string
	LastUpdate time.Time
}

Jump to

Keyboard shortcuts

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