Documentation
¶
Index ¶
- func FindData(fileContent string, pattern Pattern) (int, int, string)
- func FindDataWithAlternative(fileContent string, pattern1, pattern2 Pattern) (int, int, string)
- func FindDataWithCode(fileContent, startStr, endStr string) (int, int, string, string, string)
- func MatchMiddle(fileContent string, pattern PatternMiddle, ...) string
- func ParseCommand(command string) types.TerminalCommand
- func ReplaceData[F ReplaceTypes](fileContent, startStr, endStr string, op F, opt ...ReplaceDataOptions) string
- func ReplaceDataFunc(fileContent, startStr, endStr string, process func(data string) string) string
- func ReplaceDataString(fileContent, startStr, endStr string, replaceWith string) string
- type ParseResult
- type Pattern
- type PatternMiddle
- type ReplaceDataOptions
- type ReplaceTypes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindDataWithAlternative ¶
func FindDataWithCode ¶
func MatchMiddle ¶
func MatchMiddle(fileContent string, pattern PatternMiddle, process func(part1, part2 string) string) string
func ParseCommand ¶
func ParseCommand(command string) types.TerminalCommand
func ReplaceData ¶
func ReplaceData[F ReplaceTypes](fileContent, startStr, endStr string, op F, opt ...ReplaceDataOptions) string
func ReplaceDataFunc ¶
func ReplaceDataString ¶
Types ¶
type ParseResult ¶
type ParseResult struct {
IsStream bool
IsEdit bool
Before []types.TerminalCommand
Cmd []types.TerminalCommand
After []types.TerminalCommand
CodeBlockShowStart int
CodeBlockShowEnd int
NewCode string
InjectCode bool
Path string
Lang string
ID string
JS string
Endpoint string
}
func ParseCast ¶
func ParseCast(cast string, code string) ParseResult
type Pattern ¶
func NewShortPattern ¶
type PatternMiddle ¶
type PatternMiddle struct {
Start string
StartAlt string
Middle string
MiddleStart string
MiddleEnd string
End string
EndAlt string
}
func PatternMiddleSimple ¶
func PatternMiddleSimple(start, middle, end string) PatternMiddle
type ReplaceDataOptions ¶
Click to show internal directories.
Click to hide internal directories.