options

package
v0.22.8 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package options is the home of the Options type, used to control optional behavior of core types such as Source.

Index

Constants

View Source
const (
	// OptHasHeader is the key for a header option.
	OptHasHeader = "header"

	// OptCols is the key for a cols option.
	OptCols = "cols"

	// OptDelim the key for a delimiter option.
	OptDelim = "delim"
)

Variables

This section is empty.

Functions

func GetColNames

func GetColNames(o Options) (colNames []string, err error)

GetColNames returns column names specified like "--opts=cols=A,B,C".

func HasHeader

func HasHeader(opts Options) (header, ok bool, err error)

HasHeader checks if src.Options has "header=true".

Types

type Options

type Options url.Values

Options are optional values akin to url.Values.

func ParseOptions

func ParseOptions(options string, allowedOpts ...string) (Options, error)

ParseOptions parses the URL-encoded options string. If allowedOpts is non-empty, the options are tested for basic correctness. See url.ParseQuery.

func (Options) Add

func (o Options) Add(key, value string)

Add is documented by url.Values.Add.

func (Options) Clone

func (o Options) Clone() Options

Clone returns a deep copy of o. If o is nil, nil is returned.

func (Options) Encode

func (o Options) Encode() string

Encode is documented by url.Values.Encode.

func (Options) Get

func (o Options) Get(key string) string

Get is documented by url.Values.Get.

Jump to

Keyboard shortcuts

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