parser

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Repo   string
	Key    string
	Short  string
	Long   string
	Branch string
	Tag    string
}

Command represents a parsed command with its associated metadata.

type IParser

type IParser interface {
	Read() (map[string]interface{}, error)
	Create()
	ExtractCommands()
	Refresh()
	DeleteSection()
}

IParser defines the interface for parsing operations.

type Parser

type Parser struct {
	File        string
	Commmands   []Command
	Content     []byte
	ContentRead bool
}

Parser is a struct that holds the file information and parsed commands.

func (*Parser) DeleteSection

func (p *Parser) DeleteSection(name string)

DeleteSection removes a section from the configuration by its name.

func (*Parser) ExtractCommands

func (p *Parser) ExtractCommands() error

ExtractCommands reads and processes commands from the configuration file.

func (*Parser) Read

func (p *Parser) Read() (map[string]interface{}, error)

func (*Parser) Refresh

func (p *Parser) Refresh()

Refresh reloads the commands from the configuration file.

func (*Parser) Write

func (p *Parser) Write(tmpl *Template)

func (*Parser) WriteSection

func (p *Parser) WriteSection(tmpl *Template, name string)

WriteSection updates or adds a section in the TOML configuration based on the provided template and section name.

type Template

type Template struct {
	Name        string
	Repo        string
	Description string
	Summary     string
	Branch      string
	Tag         string
}

Template represents the structure for storing template metadata.

Jump to

Keyboard shortcuts

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