Documentation ¶
Index ¶
- Variables
- func GuessContentType(v []byte) string
- func GuessFormatIsBinary(v []byte) bool
- type Action
- type ActionRegistry
- type ActionType
- type Data
- func (d *Data) StackString() string
- func (d *Data) StoreGeomValue(g geom.Geometry, a *Action) *Data
- func (d *Data) StoreJSONValue(t time.Time, a *Action) *Data
- func (d *Data) StoreTextListValue(l []string, a *Action) *Data
- func (d *Data) StoreTextValue(v []byte, a *Action) *Data
- func (d *Data) StoreTimeValue(t time.Time, a *Action) *Data
- func (d *Data) String() string
- func (d *Data) Undo(in []byte) (*Data, *Action, error)
- type Format
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmptyStack = errors.New("empty stack")
Functions ¶
func GuessContentType ¶
func GuessFormatIsBinary ¶
Types ¶
type Action ¶
type Action struct { Doc string Names []string // command and aliases Type ActionType InputFormat Format OutputFormat Format // change it to a variadic opts ... Func func(any) (any, error) }
func (*Action) Description ¶
func (*Action) FilterValue ¶
type ActionRegistry ¶
type ActionRegistry struct {
// contains filtered or unexported fields
}
func DefaultRegistry ¶
func DefaultRegistry() *ActionRegistry
func NewRegistry ¶
func NewRegistry() *ActionRegistry
func (*ActionRegistry) ActionsForData ¶
func (r *ActionRegistry) ActionsForData(data *Data) (actions []*Action)
func (*ActionRegistry) ActionsForText ¶
func (r *ActionRegistry) ActionsForText(search string) (actions []*Action)
ActionsForText returns a list of actions, prefix by search, all if search is empty ordered alphabetically
func (*ActionRegistry) RegisterAction ¶
func (r *ActionRegistry) RegisterAction(a Action)
RegisterAction registers an action by its input , names
func (*ActionRegistry) RegisterActions ¶
func (r *ActionRegistry) RegisterActions(actions ...Action)
RegisterActions registers multiple actions by their input format, names
Click to show internal directories.
Click to hide internal directories.