data

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMainAlreadyExists error = errors.New("main set already exists")
	ErrMainSetNotFound   error = errors.New("main set not found")
	ErrTagAlreadyExists  error = errors.New("tag already exists")
	ErrTagNotProvided    error = errors.New("tag not provided")
	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) DeleteSet

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

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) (Set, 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) 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) NewFromSet

func (d *Box) NewFromSet(set Set) (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 []Set) ([]string, error)

func (*Box) OverwriteSet added in v0.2.0

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

func (*Box) SearchSetByKeyPattern

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

func (*Box) SearchSetByKeyTagPattern

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

func (*Box) TagAlreadyExists

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

type BoxData

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

func JustLoadBox added in v0.0.6

func JustLoadBox() BoxData

type Set

type Set struct {
	Tag        string    `json:"tag,omitempty"`
	Type       string    `json:"type"`
	Content    string    `json:"content"`
	Extension  string    `json:"extension"`
	LastUpdate time.Time `json:"lastUpdate"`
	Version    int       `json:"version"`
}

type SetView

type SetView struct {
	Tag        string    `json:"tag"`
	Key        string    `json:"key"`
	Type       string    `json:"type"`
	Content    string    `json:"content"`
	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"`
	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