pages

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const MaxState = 256 << 10

Variables

View Source
var ErrAt = errors.New("a section is an element id: letters, digits and - _ . :")
View Source
var ErrTooBig = errors.New("state is at most 256 KB")

Functions

func Link(sid, ref string) string

func Merge

func Merge(old, v json.RawMessage) json.RawMessage

func Name

func Name(s string) string

func Ref

func Ref(name, at string) (string, error)

func Slug

func Slug(s string) string

func Target

func Target(path string) (string, error)

Types

type Page

type Page struct {
	Session string              `json:"session"`
	Name    string              `json:"name"`
	Title   string              `json:"title,omitempty"`
	Path    string              `json:"path"`
	Note    string              `json:"note,omitempty"`
	At      string              `json:"at,omitempty"`
	Shown   time.Time           `json:"shown"`
	Kind    string              `json:"kind,omitempty"`
	Updated time.Time           `json:"updated,omitzero"`
	StateAt time.Time           `json:"stateAt,omitzero"`
	Size    int64               `json:"size,omitempty"`
	Gone    bool                `json:"gone,omitempty"`
	URL     string              `json:"url,omitempty"`
	Host    string              `json:"host,omitempty"`
	Of      string              `json:"of,omitempty"`
	Cwd     string              `json:"cwd,omitempty"`
	Actions map[string][]string `json:"actions,omitempty"`
}

func (Page) Last

func (p Page) Last() time.Time

func (Page) Ref

func (p Page) Ref() string

type Store

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

func Open

func Open(path string) (*Store, error)

func (*Store) All

func (st *Store) All() []Page

func (*Store) Get

func (st *Store) Get(sid, name string) (Page, bool)

func (*Store) Of

func (st *Store) Of(sid string) []Page

func (*Store) Owners

func (st *Store) Owners() []string

func (*Store) Remove

func (st *Store) Remove(sid, name string) (bool, error)

func (*Store) SetState

func (st *Store) SetState(sid, name string, v json.RawMessage) error

func (*Store) Show

func (st *Store) Show(p Page) (Page, bool, error)

func (*Store) State

func (st *Store) State(sid, name string) json.RawMessage

Jump to

Keyboard shortcuts

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