param

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package param contains the Param interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MayTakeValue

func MayTakeValue(p Param) bool

MayTakeValue returns true if the Param was constructed with something other than a *bool.

func MustTakeValue

func MustTakeValue(p Param) bool

MustTakeValue returns true if the Param was constructed with something other than a *bool or a pointer to a pointer type.

Types

type Param

type Param interface {
	Set(string) error
}

Param is the interface that all custom config struct field types must satisfy.

See Run for more details on how Param is used.

As a high-level recommendation, note that you usually want to implement Param by taking a pointer receiver; Set should typically mutate the inner value of your Param implementation.

func New

func New(v interface{}) (Param, error)

New constructs a new Param from a pointer or Param implementation.

If v implements Param, then New returns back v. Otherwise, New will return back a Param implementation if the type is supported by the rules described in Run. If the type is not supported, New returns an error.

Jump to

Keyboard shortcuts

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