Documentation
¶
Index ¶
- Variables
- func ApplyResults(ctx context.Context, client Applier, results []Result)
- func ApplyResultsWithOptions(ctx context.Context, client Applier, results []Result, asChild bool)
- func ApplySplitResults(ctx context.Context, client Applier, results []SplitResult)
- func BuildUpdateRequest(result *Result) *workflowy.UpdateNodeRequest
- func Capitalize(s string) (string, error)
- func CollectSplits(items []*workflowy.Item, separator string, field Field, skipEmpty bool, ...)
- func CollectTransformations(items []*workflowy.Item, opts Options, depth int, results *[]Result)
- func ListBuiltins() []string
- func Lowercase(s string) (string, error)
- func RemovePunctuation(s string) (string, error)
- func RemoveWhitespace(s string) (string, error)
- func Split(text, separator string, skipEmpty bool) []string
- func TitleCase(s string) (string, error)
- func Trim(s string) (string, error)
- func UnescapeSeparator(s string) string
- func Uppercase(s string) (string, error)
- type Applier
- type Field
- type Options
- type Result
- type SplitResult
- type Transformer
Constants ¶
This section is empty.
Variables ¶
View Source
var BuiltinTransformers = map[string]Transformer{ "lowercase": Lowercase, "uppercase": Uppercase, "capitalize": Capitalize, "title": TitleCase, "trim": Trim, "no-punctuation": RemovePunctuation, "no-whitespace": RemoveWhitespace, }
Functions ¶
func ApplyResultsWithOptions ¶
func ApplySplitResults ¶
func ApplySplitResults(ctx context.Context, client Applier, results []SplitResult)
func BuildUpdateRequest ¶
func BuildUpdateRequest(result *Result) *workflowy.UpdateNodeRequest
func Capitalize ¶
func CollectSplits ¶
func CollectTransformations ¶
func ListBuiltins ¶
func ListBuiltins() []string
func RemovePunctuation ¶
func RemoveWhitespace ¶
func UnescapeSeparator ¶
Types ¶
type Applier ¶
type Applier interface {
UpdateNode(ctx context.Context, itemID string, req *workflowy.UpdateNodeRequest) (*workflowy.UpdateNodeResponse, error)
CreateNode(ctx context.Context, req *workflowy.CreateNodeRequest) (*workflowy.CreateNodeResponse, error)
}
type Result ¶
type Result struct {
Item *workflowy.Item `json:"-"`
ID string `json:"id"`
URL string `json:"url"`
Field string `json:"field"`
Original string `json:"original"`
New string `json:"new"`
Applied bool `json:"applied"`
Skipped bool `json:"skipped,omitempty"`
SkipReason string `json:"skip_reason,omitempty"`
Error error `json:"error,omitempty"`
CreatedID string `json:"created_id,omitempty"`
}
type SplitResult ¶
type SplitResult struct {
ParentID string `json:"parent_id"`
ParentURL string `json:"parent_url"`
Original string `json:"original"`
Parts []string `json:"parts"`
CreatedIDs []string `json:"created_ids,omitempty"`
Applied bool `json:"applied"`
Skipped bool `json:"skipped,omitempty"`
SkipReason string `json:"skip_reason,omitempty"`
}
func (SplitResult) String ¶
func (r SplitResult) String() string
type Transformer ¶
func ResolveTransformer ¶
func ResolveTransformer(transformName, execCmd string) (Transformer, error)
func ShellTransformer ¶
func ShellTransformer(cmdTemplate string) Transformer
Click to show internal directories.
Click to hide internal directories.