viewerlayout

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 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 MaxAttachmentBytes = 8192

MaxAttachmentBytes bounds the compact JSON encoding of one untrusted hint.

Variables

View Source
var ErrChanged = errors.New("the layout changed; read it again before saving")
View Source
var ErrInvalid = errors.New("invalid layout")
View Source
var ErrRequired = errors.New("read the layout first and send its ETag as If-Match")

Functions

func Validate

func Validate(doc Document) error

Validate checks the shared viewer layout grammar without writing storage.

Types

type Document

type Document struct {
	Layout *state.PaneLayoutJSON `json:"layout" jsonschema:"nullable"`
}

Document uses the existing codec's tree vocabulary. It deliberately contains no viewer identifier or cell geometry; auth selects the viewer.

type FileStore

type FileStore struct{ Dir string }

func (FileStore) Get

func (s FileStore) Get(viewer, project string) (Document, string, error)

func (FileStore) Put

func (s FileStore) Put(viewer, project, match string, doc Document) (Document, string, error)

type Store

type Store interface {
	Get(viewer, project string) (Document, string, error)
	Put(viewer, project, match string, document Document) (Document, string, error)
}

Store is the presentation-neutral persistence seam for viewer preferences. FileStore serializes read/compare/write across processes with an OS lock.

Jump to

Keyboard shortcuts

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