type_blobs

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeFieldDefinitionInto

func DecodeFieldDefinitionInto(data *FieldDefinition, doc *document.Document, container *cst.Node, consumed map[string]bool, keyPrefix string) error

func DecodeReferencesConfigInto

func DecodeReferencesConfigInto(data *ReferencesConfig, doc *document.Document, container *cst.Node, consumed map[string]bool, keyPrefix string) error

func DecodeTomlV0Into

func DecodeTomlV0Into(data *TomlV0, doc *document.Document, container *cst.Node, consumed map[string]bool, keyPrefix string) error

func DecodeTomlV1Into

func DecodeTomlV1Into(data *TomlV1, doc *document.Document, container *cst.Node, consumed map[string]bool, keyPrefix string) error

func DecodeTomlV2Into

func DecodeTomlV2Into(data *TomlV2, doc *document.Document, container *cst.Node, consumed map[string]bool, keyPrefix string) error

func EncodeFieldDefinitionFrom

func EncodeFieldDefinitionFrom(data *FieldDefinition, doc *document.Document, container *cst.Node) error

func EncodeReferencesConfigFrom

func EncodeReferencesConfigFrom(data *ReferencesConfig, doc *document.Document, container *cst.Node) error

func EncodeTomlV0From

func EncodeTomlV0From(data *TomlV0, doc *document.Document, container *cst.Node) error

func EncodeTomlV1From

func EncodeTomlV1From(data *TomlV1, doc *document.Document, container *cst.Node) error

func EncodeTomlV2From

func EncodeTomlV2From(data *TomlV2, doc *document.Document, container *cst.Node) error

Types

type Blob

type Blob interface {
	GetFileExtension() string
	GetBinary() bool
	GetMimeType() string
	GetVimSyntaxType() string

	WithFormatters
	WithFormatterUTIGroups
	WithStringLuaHooks
	WithReferences
}

type FieldDefinition

type FieldDefinition struct {
	Name    string   `toml:"name"`
	Kind    string   `toml:"kind"`
	Values  []string `toml:"values,omitempty"`
	Default string   `toml:"default,omitempty"`
}

func (*FieldDefinition) ToDefinition

func (fd *FieldDefinition) ToDefinition() fields.Definition

type FieldDefinitionDocument

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

func DecodeFieldDefinition

func DecodeFieldDefinition(input []byte) (*FieldDefinitionDocument, error)

func (*FieldDefinitionDocument) Comment

func (d *FieldDefinitionDocument) Comment(key string) string

func (*FieldDefinitionDocument) Data

func (*FieldDefinitionDocument) Encode

func (d *FieldDefinitionDocument) Encode() ([]byte, error)

func (*FieldDefinitionDocument) InlineComment

func (d *FieldDefinitionDocument) InlineComment(key string) string

func (*FieldDefinitionDocument) SetComment

func (d *FieldDefinitionDocument) SetComment(key, comment string)

func (*FieldDefinitionDocument) SetInlineComment

func (d *FieldDefinitionDocument) SetInlineComment(key, comment string)

func (*FieldDefinitionDocument) Undecoded

func (d *FieldDefinitionDocument) Undecoded() []string

type ReferencesConfig

type ReferencesConfig struct {
	script_config.ScriptConfig
	Optional bool `toml:"optional,omitempty"`
}

type ReferencesConfigDocument

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

func DecodeReferencesConfig

func DecodeReferencesConfig(input []byte) (*ReferencesConfigDocument, error)

func (*ReferencesConfigDocument) Comment

func (d *ReferencesConfigDocument) Comment(key string) string

func (*ReferencesConfigDocument) Data

func (*ReferencesConfigDocument) Encode

func (d *ReferencesConfigDocument) Encode() ([]byte, error)

func (*ReferencesConfigDocument) InlineComment

func (d *ReferencesConfigDocument) InlineComment(key string) string

func (*ReferencesConfigDocument) SetComment

func (d *ReferencesConfigDocument) SetComment(key, comment string)

func (*ReferencesConfigDocument) SetInlineComment

func (d *ReferencesConfigDocument) SetInlineComment(key, comment string)

func (*ReferencesConfigDocument) Undecoded

func (d *ReferencesConfigDocument) Undecoded() []string

type TomlV0

type TomlV0 struct {
	InlineBlob    bool                        `toml:"inline-akte,omitempty"`
	Archived      bool                        `toml:"archived,omitempty"`
	FileExtension string                      `toml:"file-extension,omitempty"`
	ExecCommand   *script_config.ScriptConfig `toml:"exec-command,omitempty"`
	VimSyntaxType string                      `toml:"vim-syntax-type"`
	// TODO-P4 rename to uti-groups
	FormatterUTIGroups map[string]UTIGroup                       `toml:"formatter-uti-groups"`
	Formatters         map[string]script_config.WithOutputFormat `toml:"formatters,omitempty"`
	Actions            map[string]script_config.ScriptConfig     `toml:"actions,omitempty"`
	Hooks              string                                    `toml:"hooks"`
}

func (*TomlV0) GetBinary

func (blob *TomlV0) GetBinary() bool

func (*TomlV0) GetFileExtension

func (blob *TomlV0) GetFileExtension() string

func (*TomlV0) GetFormatterUTIGroups

func (blob *TomlV0) GetFormatterUTIGroups() map[string]UTIGroup

func (*TomlV0) GetFormatters

func (blob *TomlV0) GetFormatters() map[string]script_config.WithOutputFormat

func (*TomlV0) GetMimeType

func (blob *TomlV0) GetMimeType() string

func (*TomlV0) GetReferences

func (blob *TomlV0) GetReferences() *ReferencesConfig

func (*TomlV0) GetStringLuaHooks

func (blob *TomlV0) GetStringLuaHooks() string

func (*TomlV0) GetVimSyntaxType

func (blob *TomlV0) GetVimSyntaxType() string

func (*TomlV0) Reset

func (blob *TomlV0) Reset()

type TomlV0Document

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

func DecodeTomlV0

func DecodeTomlV0(input []byte) (*TomlV0Document, error)

func (*TomlV0Document) Comment

func (d *TomlV0Document) Comment(key string) string

func (*TomlV0Document) Data

func (d *TomlV0Document) Data() *TomlV0

func (*TomlV0Document) Encode

func (d *TomlV0Document) Encode() ([]byte, error)

func (*TomlV0Document) InlineComment

func (d *TomlV0Document) InlineComment(key string) string

func (*TomlV0Document) SetComment

func (d *TomlV0Document) SetComment(key, comment string)

func (*TomlV0Document) SetInlineComment

func (d *TomlV0Document) SetInlineComment(key, comment string)

func (*TomlV0Document) Undecoded

func (d *TomlV0Document) Undecoded() []string

type TomlV1

type TomlV1 struct {
	Binary        bool                                      `toml:"binary,omitempty"`
	FileExtension string                                    `toml:"file-extension,omitempty"`
	MimeType      string                                    `toml:"mime-type,omitempty"`
	ExecCommand   *script_config.ScriptConfig               `toml:"exec-command,omitempty"`
	VimSyntaxType string                                    `toml:"vim-syntax-type"`
	UTIGroups     map[string]UTIGroup                       `toml:"uti-groups"`
	Formatters    map[string]script_config.WithOutputFormat `toml:"formatters,omitempty"`

	Hooks      string            `toml:"hooks"`
	References *ReferencesConfig `toml:"references,omitempty"`
}

func (*TomlV1) GetBinary

func (blob *TomlV1) GetBinary() bool

func (*TomlV1) GetFileExtension

func (blob *TomlV1) GetFileExtension() string

func (*TomlV1) GetFormatterUTIGroups

func (blob *TomlV1) GetFormatterUTIGroups() map[string]UTIGroup

func (*TomlV1) GetFormatters

func (blob *TomlV1) GetFormatters() map[string]script_config.WithOutputFormat

func (*TomlV1) GetMimeType

func (blob *TomlV1) GetMimeType() string

func (*TomlV1) GetReferences

func (blob *TomlV1) GetReferences() *ReferencesConfig

func (*TomlV1) GetStringLuaHooks

func (blob *TomlV1) GetStringLuaHooks() string

func (*TomlV1) GetVimSyntaxType

func (blob *TomlV1) GetVimSyntaxType() string

func (*TomlV1) Reset

func (blob *TomlV1) Reset()

type TomlV1Document

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

func DecodeTomlV1

func DecodeTomlV1(input []byte) (*TomlV1Document, error)

func (*TomlV1Document) Comment

func (d *TomlV1Document) Comment(key string) string

func (*TomlV1Document) Data

func (d *TomlV1Document) Data() *TomlV1

func (*TomlV1Document) Encode

func (d *TomlV1Document) Encode() ([]byte, error)

func (*TomlV1Document) InlineComment

func (d *TomlV1Document) InlineComment(key string) string

func (*TomlV1Document) SetComment

func (d *TomlV1Document) SetComment(key, comment string)

func (*TomlV1Document) SetInlineComment

func (d *TomlV1Document) SetInlineComment(key, comment string)

func (*TomlV1Document) Undecoded

func (d *TomlV1Document) Undecoded() []string

type TomlV2

type TomlV2 struct {
	Binary        bool                                      `toml:"binary,omitempty"`
	FileExtension string                                    `toml:"file-extension,omitempty"`
	MimeType      string                                    `toml:"mime-type,omitempty"`
	ExecCommand   *script_config.ScriptConfig               `toml:"exec-command,omitempty"`
	VimSyntaxType string                                    `toml:"vim-syntax-type"`
	UTIGroups     map[string]UTIGroup                       `toml:"uti-groups"`
	Formatters    map[string]script_config.WithOutputFormat `toml:"formatters,omitempty"`

	Hooks      string            `toml:"hooks"`
	References *ReferencesConfig `toml:"references,omitempty"`

	Fields       []FieldDefinition           `toml:"fields,omitempty"`
	FieldsReader *script_config.ScriptConfig `toml:"fields-reader,omitempty"`
	FieldsWriter *script_config.ScriptConfig `toml:"fields-writer,omitempty"`
}

func Default

func Default() TomlV2

func DefaultChoreType

func DefaultChoreType() TomlV2

DefaultChoreType returns the built-in !chore type blob. Same field set as !task; calendar-to-type binding stays a workspace config concern (the CalDAV haustoria's tasks calendar binds to !task and chores binds to !chore). Future !actionable abstract type will replace the duplication.

func DefaultPandocDefaults

func DefaultPandocDefaults() TomlV2

func DefaultPandocLuaFilter

func DefaultPandocLuaFilter() TomlV2

func DefaultTaskType

func DefaultTaskType() TomlV2

DefaultTaskType returns the built-in !task type blob, used by genesis when BigBang.IncludeBuiltinActionableTypes is set. !task instances are stored as TOML blobs mirroring the field values; the reader script projects them into the index on commit, the writer script projects user edits back into the blob during organize mutations. The CalDAV haustoria emits these blobs directly during compile.

func DefaultWithPandocFormatter

func DefaultWithPandocFormatter() TomlV2

func (*TomlV2) GetBinary

func (blob *TomlV2) GetBinary() bool

func (*TomlV2) GetFieldDefinitions

func (blob *TomlV2) GetFieldDefinitions() []FieldDefinition

func (*TomlV2) GetFieldsReader

func (blob *TomlV2) GetFieldsReader() *script_config.ScriptConfig

func (*TomlV2) GetFieldsWriter

func (blob *TomlV2) GetFieldsWriter() *script_config.ScriptConfig

func (*TomlV2) GetFileExtension

func (blob *TomlV2) GetFileExtension() string

func (*TomlV2) GetFormatterUTIGroups

func (blob *TomlV2) GetFormatterUTIGroups() map[string]UTIGroup

func (*TomlV2) GetFormatters

func (blob *TomlV2) GetFormatters() map[string]script_config.WithOutputFormat

func (*TomlV2) GetMimeType

func (blob *TomlV2) GetMimeType() string

func (*TomlV2) GetReferences

func (blob *TomlV2) GetReferences() *ReferencesConfig

func (*TomlV2) GetStringLuaHooks

func (blob *TomlV2) GetStringLuaHooks() string

func (*TomlV2) GetVimSyntaxType

func (blob *TomlV2) GetVimSyntaxType() string

func (*TomlV2) Reset

func (blob *TomlV2) Reset()

type TomlV2Document

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

func DecodeTomlV2

func DecodeTomlV2(input []byte) (*TomlV2Document, error)

func (*TomlV2Document) Comment

func (d *TomlV2Document) Comment(key string) string

func (*TomlV2Document) Data

func (d *TomlV2Document) Data() *TomlV2

func (*TomlV2Document) Encode

func (d *TomlV2Document) Encode() ([]byte, error)

func (*TomlV2Document) InlineComment

func (d *TomlV2Document) InlineComment(key string) string

func (*TomlV2Document) SetComment

func (d *TomlV2Document) SetComment(key, comment string)

func (*TomlV2Document) SetInlineComment

func (d *TomlV2Document) SetInlineComment(key, comment string)

func (*TomlV2Document) Undecoded

func (d *TomlV2Document) Undecoded() []string

type UTIGroup

type UTIGroup map[string]string

func (*UTIGroup) Equals

func (group *UTIGroup) Equals(b UTIGroup) bool

func (UTIGroup) Map

func (group UTIGroup) Map() map[string]string

func (*UTIGroup) Merge

func (group *UTIGroup) Merge(ct2 UTIGroup)

type WithFields

type WithFields interface {
	GetFieldDefinitions() []FieldDefinition
	GetFieldsReader() *script_config.ScriptConfig
	GetFieldsWriter() *script_config.ScriptConfig
}

type WithFormatterUTIGroups

type WithFormatterUTIGroups interface {
	GetFormatterUTIGroups() map[string]UTIGroup
}

type WithFormatters

type WithFormatters interface {
	GetFormatters() map[string]script_config.WithOutputFormat
}

type WithReferences

type WithReferences interface {
	GetReferences() *ReferencesConfig
}

type WithStringLuaHooks

type WithStringLuaHooks interface {
	GetStringLuaHooks() string
}

TODO make typed hooks

Source Files

  • field_definition.go
  • field_definition_tommy.go
  • main.go
  • references_config.go
  • references_config_tommy.go
  • toml_v0.go
  • toml_v0_tommy.go
  • toml_v1.go
  • toml_v1_tommy.go
  • toml_v2.go
  • toml_v2_tommy.go
  • uti_group.go

Jump to

Keyboard shortcuts

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