qbtm

package
v0.0.0-...-8736a9b Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseArgs

func ParseArgs(args string) string

ParseArgs parses (Text t, Number p, Text d) into ($1, $2, $3).

func ParseCSV

func ParseCSV(opts *Opts, parser Parser) error

ParseCSV parses the CSV file.

func Unique

func Unique(in []string) []string

Unique sorts and deduplicates a slice of strings. See https://github.com/golang/go/wiki/SliceTricks#in-place-deduplicate-comparable

Types

type FunctionParser

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

FunctionParser parses functions from the CSV file.

func NewFunctionParser

func NewFunctionParser() *FunctionParser

NewFunctionParser returns a new *FunctionParser.

func (*FunctionParser) Row

func (p *FunctionParser) Row(row []string) error

Row implements Parser.Row by checking whether the first character of the value in the second column is an uppercase letter.

func (*FunctionParser) String

func (p *FunctionParser) String() string

type OperationParser

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

OperationParser parses functions from the CSV file.

func NewOperationParser

func NewOperationParser() *OperationParser

NewOperationParser returns a new *OperationParser.

func (*OperationParser) Row

func (p *OperationParser) Row(row []string) error

Row implements Parser.Row by checking whether the first character of the value in the second column is not a letter.

func (*OperationParser) String

func (p *OperationParser) String() string

type Opts

type Opts struct {
	File string `` /* 168-byte string literal not displayed */
}

Opts contaiins command options.

type Parser

type Parser interface {
	fmt.Stringer
	Row([]string) error
}

Parser parses data from the CSV file.

type Snippet

type Snippet struct {
	Prefix      []string `json:"prefix"`
	Body        []string `json:"body"`
	Description string   `json:"description"`
}

Snippet models a snippet.

type SnippetParser

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

SnippetParser parses functions from the CSV file.

func NewSnippetParser

func NewSnippetParser() *SnippetParser

NewSnippetParser returns a new *SnippetParser.

func (*SnippetParser) Row

func (p *SnippetParser) Row(row []string) error

Row implements Parser.Row.

func (*SnippetParser) String

func (p *SnippetParser) String() string

Jump to

Keyboard shortcuts

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