repository

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound      = errors.New("not found")
	ErrAlreadyExists = errors.New("already exists")
)

Functions

This section is empty.

Types

type Database

type Database struct {
	Stacks map[name]*Stack
	Name   string
	ID     uuid.UUID
	// contains filtered or unexported fields
}

func (*Database) Drop

func (db *Database) Drop(id string) error

func (*Database) Len

func (db *Database) Len() int

func (*Database) New

func (db *Database) New(n string) (*Stack, error)

func (*Database) SortStacks

func (db *Database) SortStacks() []*Stack

func (*Database) Stack

func (db *Database) Stack(id string) (*Stack, error)

type Repository

type Repository struct {
	Databases map[name]*Database
	// contains filtered or unexported fields
}

func New

func New() *Repository

func (*Repository) Database

func (r *Repository) Database(id string) (*Database, error)

func (*Repository) Drop

func (r *Repository) Drop(id string) error

func (*Repository) Len

func (r *Repository) Len() int

func (*Repository) Load added in v0.0.6

func (r *Repository) Load(filename string) error

func (*Repository) New

func (r *Repository) New(n string) (*Database, error)

func (*Repository) Persist added in v0.0.6

func (r *Repository) Persist(filename string) error

func (*Repository) SortDatabases

func (r *Repository) SortDatabases() []*Database

type Stack

type Stack struct {
	CreatedAt time.Time
	UpdatedAt time.Time
	ReadAt    time.Time

	Name string
	Data []any

	ID uuid.UUID
	// contains filtered or unexported fields
}

func (*Stack) Database

func (s *Stack) Database() *Database

func (*Stack) Flush

func (s *Stack) Flush()

func (*Stack) Peek

func (s *Stack) Peek() any

func (*Stack) Pop

func (s *Stack) Pop() any

func (*Stack) Push

func (s *Stack) Push(element any)

func (*Stack) Size

func (s *Stack) Size() int

Jump to

Keyboard shortcuts

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