strconv

package
v0.0.0-...-5a1941a Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2016 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package strconv contains code generation staff related to github.com/goaltools/goal/strconv package.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedType = errors.New("unsupported type")

ErrUnsupportedType is an error that indicates that there is no conversion function for the requested type.

Functions

This section is empty.

Types

type FnMap

type FnMap map[string]reflect.Func

FnMap is a mapping between type names and appropriate conversion functions.

func Context

func Context() FnMap

Context returns mappings between types that can be parsed using strconv package and functions for that conversions. All conversion functions meet the following criteria: 1. They are exported. 2. They expect 3 arguments: url.Values, string, ...int. 3. They return 1 argument. This is useful for code generation.

func (FnMap) Render

func (m FnMap) Render(pkgName, vsName string, a reflect.Arg) (string, error)

Render gets a package name, name of url.Values variable and an argument, and renders an appropriate strconv Function, e.g. `strconv.Int(r.Form, "number")`. If the argument is not supported error will be returned as a second argument. This is used for code generation.

Jump to

Keyboard shortcuts

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