mappers

package
v0.0.0-...-51d629d Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2016 License: BSD-3-Clause, BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Mappers contains functions that will map an input to an output. These are convenience functions that are gathered here to reduce the problem of circular references

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResponseFromUser

func ResponseFromUser(rtn *response.UserReturn, user *tenant.User) *response.UserReturn

ResponseFromUser takes a user record and copies the relevant fields from the user's record.

func StrToBool

func StrToBool(val string, defaultVal bool) bool

func StrToInt

func StrToInt(t string) int

func StrToTime

func StrToTime(t string) time.Time

func UserField

func UserField(user *tenant.User, key, value string) (found bool, rtn error)

UserField will find map a fieldname to a user record and save the field in the record

func UserFromCli

func UserFromCli(rtn *tenant.User, r *tenant.UserCli) (ortn *tenant.User, err error)

UserFromCli copy fields from the user cli record to the rtn record. We return the same record passed, so you can safely ignore the return See: UserReturn

Types

type ErrFunctionBoolSetter

type ErrFunctionBoolSetter func(bool) error

type ErrFunctionSetter

type ErrFunctionSetter func(string) error

type ErrSetter

type ErrSetter struct {
	Err error
}

func (*ErrSetter) Set

func (e *ErrSetter) Set(setter ErrFunctionSetter, val string) error

func (*ErrSetter) SetBool

func (e *ErrSetter) SetBool(setter ErrFunctionBoolSetter, val bool) error

Jump to

Keyboard shortcuts

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