Documentation
¶
Index ¶
- Variables
- func DecodeV0Into(data *V0, doc *document.Document, container *cst.Node, ...) error
- func DecodeV1Into(data *V1, doc *document.Document, container *cst.Node, ...) error
- func DecodeV2Into(data *V2, doc *document.Document, container *cst.Node, ...) error
- func EncodeV0From(data *V0, doc *document.Document, container *cst.Node) error
- func EncodeV1From(data *V1, doc *document.Document, container *cst.Node) error
- func EncodeV2From(data *V2, doc *document.Document, container *cst.Node) error
- type CalDAVConfig
- type CalendarConfig
- type Config
- type ConfigTemporary
- type ConfigWithDefaultQueryString
- type ConfigWithDryRun
- type ConfigWithHaustoria
- type ConfigWithParentPath
- type ConfigWithRepo
- type ConfigWithSyncBaseline
- type FolderConfig
- type HaustoriaConfig
- type OrgmodeConfig
- type OrgmodeSFTP
- type OrgmodeWebDAV
- type ResolvedCalDAVConfig
- type ResolvedOrgmodeConfig
- type Temporary
- type TypedConfig
- type V0
- type V0Document
- func (d *V0Document) Comment(key string) string
- func (d *V0Document) Data() *V0
- func (d *V0Document) Encode() ([]byte, error)
- func (d *V0Document) InlineComment(key string) string
- func (d *V0Document) SetComment(key, comment string)
- func (d *V0Document) SetInlineComment(key, comment string)
- func (d *V0Document) Undecoded() []string
- type V1
- type V1Document
- func (d *V1Document) Comment(key string) string
- func (d *V1Document) Data() *V1
- func (d *V1Document) Encode() ([]byte, error)
- func (d *V1Document) InlineComment(key string) string
- func (d *V1Document) SetComment(key, comment string)
- func (d *V1Document) SetInlineComment(key, comment string)
- func (d *V1Document) Undecoded() []string
- type V2
- type V2Document
- func (d *V2Document) Comment(key string) string
- func (d *V2Document) Data() *V2
- func (d *V2Document) Encode() ([]byte, error)
- func (d *V2Document) InlineComment(key string) string
- func (d *V2Document) SetComment(key, comment string)
- func (d *V2Document) SetInlineComment(key, comment string)
- func (d *V2Document) Undecoded() []string
Constants ¶
This section is empty.
Variables ¶
var Coder = hyphence.CoderToTypedBlob[Config]{ Metadata: hyphence.TypedMetadataCoder[Config]{}, Blob: hyphence.CoderTypeMapWithoutType[Config]( map[string]interfaces.CoderBufferedReadWriter[*Config]{ ids.TypeTomlWorkspaceConfigV0: hyphence.CoderTommy[ Config, *Config, ]{ Decode: func(b []byte) (Config, error) { doc, err := DecodeV0(b) if err != nil { return nil, err } return doc.Data(), nil }, Encode: func(cfg Config) ([]byte, error) { doc, err := DecodeV0(nil) if err != nil { return nil, err } switch v := cfg.(type) { case *V0: *doc.Data() = *v case V0: *doc.Data() = v } return doc.Encode() }, }, ids.TypeTomlWorkspaceConfigV1: hyphence.CoderTommy[ Config, *Config, ]{ Decode: func(b []byte) (Config, error) { doc, err := DecodeV1(b) if err != nil { return nil, err } return doc.Data(), nil }, Encode: func(cfg Config) ([]byte, error) { doc, err := DecodeV1(nil) if err != nil { return nil, err } switch v := cfg.(type) { case *V1: *doc.Data() = *v case V1: *doc.Data() = v } return doc.Encode() }, }, ids.TypeTomlWorkspaceConfigV2: hyphence.CoderTommy[ Config, *Config, ]{ Decode: func(b []byte) (Config, error) { doc, err := DecodeV2(b) if err != nil { return nil, err } return doc.Data(), nil }, Encode: func(cfg Config) ([]byte, error) { doc, err := DecodeV2(nil) if err != nil { return nil, err } switch v := cfg.(type) { case *V2: *doc.Data() = *v case V2: *doc.Data() = v } return doc.Encode() }, }, }, ), }
Functions ¶
func DecodeV0Into ¶
func DecodeV1Into ¶
func DecodeV2Into ¶
Types ¶
type CalDAVConfig ¶
func (CalDAVConfig) Resolve ¶
func (c CalDAVConfig) Resolve() (ResolvedCalDAVConfig, error)
Resolve merges TOML config values with environment variables. TOML values take precedence; env vars are the fallback. Env vars: CALDAV_URL, CALDAV_USERNAME, CALDAV_PASSWORD. Password is always from CALDAV_PASSWORD (never stored in config).
type CalendarConfig ¶
type CalendarConfig struct {
URL string `toml:"url"`
Type string `toml:"type"`
Tags []string `toml:"tags,omitempty"`
}
CalendarConfig maps a CalDAV calendar to a dodder type and optional tags.
type Config ¶
type Config interface {
GetDefaults() repo_configs.Defaults
}
type ConfigTemporary ¶
type ConfigTemporary interface {
Config
// contains filtered or unexported methods
}
type ConfigWithDefaultQueryString ¶
type ConfigWithDryRun ¶
type ConfigWithDryRun interface {
Config
domain_interfaces.ConfigDryRunGetter
}
type ConfigWithHaustoria ¶
type ConfigWithHaustoria interface {
Config
GetHaustoriaConfig() HaustoriaConfig
}
type ConfigWithRepo ¶
type ConfigWithRepo interface {
GetRepoConfig() repo_configs.ConfigOverlay
}
type ConfigWithSyncBaseline ¶
type FolderConfig ¶
type FolderConfig struct {
Path string `toml:"path"`
Type string `toml:"type"`
Tags []string `toml:"tags,omitempty"`
}
FolderConfig maps a remote folder to a dodder type and optional tags.
type HaustoriaConfig ¶
type HaustoriaConfig struct {
Type string `toml:"type"`
CalDAV *CalDAVConfig `toml:"caldav,omitempty"`
Calendars map[string]CalendarConfig `toml:"calendars,omitempty"`
Orgmode *OrgmodeConfig `toml:"orgmode,omitempty"`
Folders map[string]FolderConfig `toml:"folders,omitempty"`
}
type OrgmodeConfig ¶
type OrgmodeConfig struct {
Transport string `toml:"transport"` // "webdav" or "sftp"
WebDAV *OrgmodeWebDAV `toml:"webdav,omitempty"`
SFTP *OrgmodeSFTP `toml:"sftp,omitempty"`
}
OrgmodeConfig holds orgmode haustoria connection parameters. Supports WebDAV or SFTP as the file transport.
func (OrgmodeConfig) ResolveOrgmode ¶
func (orgmodeConfig OrgmodeConfig) ResolveOrgmode() (ResolvedOrgmodeConfig, error)
ResolveOrgmode merges TOML config values with environment variables for orgmode haustoria. Env vars: ORGMODE_WEBDAV_URL, ORGMODE_WEBDAV_USERNAME, ORGMODE_WEBDAV_PASSWORD, ORGMODE_SFTP_HOST, ORGMODE_SFTP_USER, ORGMODE_SFTP_PASSWORD.
type OrgmodeSFTP ¶
type OrgmodeSFTP struct {
Host string `toml:"host"`
Port int `toml:"port"`
User string `toml:"user"`
PrivateKeyPath string `toml:"private-key-path"`
KnownHostsFile string `toml:"known-hosts-file"`
}
OrgmodeSFTP holds SFTP connection parameters for orgmode sync.
type OrgmodeWebDAV ¶
OrgmodeWebDAV holds WebDAV connection parameters for orgmode sync.
type ResolvedCalDAVConfig ¶
type ResolvedOrgmodeConfig ¶
type ResolvedOrgmodeConfig struct {
Transport string
WebDAVURL string
WebDAVUsername string
WebDAVPassword string
SFTPHost string
SFTPPort int
SFTPUser string
SFTPPassword string
SFTPPrivateKeyPath string
SFTPKnownHostsFile string
}
ResolvedOrgmodeConfig holds fully resolved orgmode connection parameters.
type Temporary ¶
type Temporary struct {
Defaults repo_configs.DefaultsV1OmitEmpty `toml:"defaults,omitempty"`
}
func (Temporary) GetDefaults ¶
func (blob Temporary) GetDefaults() repo_configs.Defaults
type V0 ¶
type V0 struct {
Defaults repo_configs.DefaultsV1OmitEmpty `toml:"defaults,omitempty"`
Query string `toml:"query,omitempty"`
DryRun bool `toml:"dry-run"`
}
func (V0) GetDefaults ¶
func (blob V0) GetDefaults() repo_configs.Defaults
type V0Document ¶
type V0Document struct {
// contains filtered or unexported fields
}
func DecodeV0 ¶
func DecodeV0(input []byte) (*V0Document, error)
func (*V0Document) Comment ¶
func (d *V0Document) Comment(key string) string
func (*V0Document) Data ¶
func (d *V0Document) Data() *V0
func (*V0Document) Encode ¶
func (d *V0Document) Encode() ([]byte, error)
func (*V0Document) InlineComment ¶
func (d *V0Document) InlineComment(key string) string
func (*V0Document) SetComment ¶
func (d *V0Document) SetComment(key, comment string)
func (*V0Document) SetInlineComment ¶
func (d *V0Document) SetInlineComment(key, comment string)
func (*V0Document) Undecoded ¶
func (d *V0Document) Undecoded() []string
type V1 ¶
type V1Document ¶
type V1Document struct {
// contains filtered or unexported fields
}
func DecodeV1 ¶
func DecodeV1(input []byte) (*V1Document, error)
func (*V1Document) Comment ¶
func (d *V1Document) Comment(key string) string
func (*V1Document) Data ¶
func (d *V1Document) Data() *V1
func (*V1Document) Encode ¶
func (d *V1Document) Encode() ([]byte, error)
func (*V1Document) InlineComment ¶
func (d *V1Document) InlineComment(key string) string
func (*V1Document) SetComment ¶
func (d *V1Document) SetComment(key, comment string)
func (*V1Document) SetInlineComment ¶
func (d *V1Document) SetInlineComment(key, comment string)
func (*V1Document) Undecoded ¶
func (d *V1Document) Undecoded() []string
type V2 ¶
type V2 struct {
V1
Haustoria HaustoriaConfig `toml:"haustoria,omitempty"`
}
func (V2) GetHaustoriaConfig ¶
func (blob V2) GetHaustoriaConfig() HaustoriaConfig
type V2Document ¶
type V2Document struct {
// contains filtered or unexported fields
}
func DecodeV2 ¶
func DecodeV2(input []byte) (*V2Document, error)
func (*V2Document) Comment ¶
func (d *V2Document) Comment(key string) string
func (*V2Document) Data ¶
func (d *V2Document) Data() *V2
func (*V2Document) Encode ¶
func (d *V2Document) Encode() ([]byte, error)
func (*V2Document) InlineComment ¶
func (d *V2Document) InlineComment(key string) string
func (*V2Document) SetComment ¶
func (d *V2Document) SetComment(key, comment string)
func (*V2Document) SetInlineComment ¶
func (d *V2Document) SetInlineComment(key, comment string)
func (*V2Document) Undecoded ¶
func (d *V2Document) Undecoded() []string
Source Files
¶
- io.go
- main.go
- temporary.go
- v0.go
- v0_tommy.go
- v1.go
- v1_tommy.go
- v2.go
- v2_tommy.go