data

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMainAlreadyExists  error = errors.New("main note already exists")
	ErrGroupAlreadyExists error = errors.New("group already exists")
	ErrMainSetNotFound    error = errors.New("main note not found")
	ErrTagAlreadyExists   error = errors.New("tag already exists")
	ErrInvalidNoteType    error = errors.New("invalid note type")
	ErrTagNotProvided     error = errors.New("tag not provided")
	ErrGroupNotFound      error = errors.New("group not found")
	ErrNoteNotFound       error = errors.New("note not found")
	ErrKeyNotFound        error = errors.New("key not found")
	ErrTagInvalid         error = errors.New("tag invalid")
)

Functions

This section is empty.

Types

type Box

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

func New

func New() *Box

func (*Box) CleanHistoryOf added in v1.0.0

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

func (*Box) CleanHistoryOfAll added in v1.0.0

func (d *Box) CleanHistoryOfAll() error

func (*Box) Delete added in v1.0.0

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

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) Get added in v1.0.0

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

func (*Box) GetGroups added in v0.9.0

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

func (*Box) GetHistoryOf added in v1.0.0

func (d *Box) GetHistoryOf(key string) ([]Change, error)

func (*Box) GetLastKey

func (d *Box) GetLastKey() string

func (*Box) GetMainKey

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

func (*Box) GroupExists added in v1.0.0

func (d *Box) GroupExists(name string) bool

func (*Box) GroupOf added in v1.1.0

func (d *Box) GroupOf(key string) (string, error)

func (*Box) List added in v1.0.0

func (d *Box) List() []NoteView

func (*Box) ListAllKeys

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

func (*Box) MainAlreadyExists

func (d *Box) MainAlreadyExists() bool

func (*Box) ManyNewFrom added in v1.0.0

func (d *Box) ManyNewFrom(notes []Note) ([]string, error)

func (*Box) ModifyAssignedGroup added in v1.0.0

func (d *Box) ModifyAssignedGroup(key, name string) error

func (*Box) ModifyContent added in v1.0.0

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

func (*Box) ModifyGroupName added in v0.9.0

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

func (*Box) ModifyTag added in v1.0.0

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

func (*Box) ModifyType added in v1.0.0

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

func (*Box) New added in v1.0.0

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

func (*Box) NewFrom added in v1.0.0

func (d *Box) NewFrom(note Note) (string, error)

func (*Box) NewGroup added in v0.9.0

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

func (*Box) NewWithTag added in v1.0.0

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

func (*Box) RemoveFromAssignedGroup added in v1.0.0

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

func (*Box) Replace added in v1.0.0

func (d *Box) Replace(key string, note Note) error

func (*Box) ReplaceBox added in v1.0.0

func (d *Box) ReplaceBox(box BoxData)

func (*Box) ResetTo added in v1.0.0

func (d *Box) ResetTo(key, subKey string) error

func (*Box) ResetToBefore added in v1.0.0

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

func (*Box) ResetToWithDeletions added in v1.0.0

func (d *Box) ResetToWithDeletions(key, subKey string) error

func (*Box) SearchByKeyPattern added in v1.0.0

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

func (*Box) SearchByKeyTagPattern added in v1.0.0

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

func (*Box) TagAlreadyExists

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

func (*Box) TagIsValid added in v1.0.0

func (d *Box) TagIsValid(tag string) error

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 Change added in v1.0.0

type Change struct {
	Key       string    `json:"key"`
	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"`
	ShadowType string    `json:"shadowType"`
	Group      string    `json:"group"`
	Content    string    `json:"content"`
	Extension  string    `json:"extension,omitempty"`
	History    []Change  `json:"history"`
	Title      string    `json:"title,omitempty"`
	LastUpdate time.Time `json:"lastUpdate"`
	Version    int       `json:"version"`
}

type NoteView added in v1.0.0

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

type SetModifier added in v0.8.4

type SetModifier interface {
	ModifyContent(key string, content string) error
	ModifyType(key string, sType string) error
}

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