Documentation ¶
Index ¶
- Constants
- func CamelToSnake(s string) (string, error)
- func ConstantTimeEqualBytes(b1, b2 []byte) bool
- func ConstantTimeEqualString(s1, s2 string) bool
- func DecodeBigInt(chars, encoded string) *big.Int
- func DecodeBytes(chars, encoded string) []byte
- func EncodeBigInt(chars string, bigInt *big.Int) string
- func EncodeBytes(chars string, b []byte) string
- func EncodeToken(token AccessToken, timeout time.Duration) (result string, err error)
- func Example(t reflect.Type) (result interface{})
- func GenerateFlags(i interface{}) (result []string, err error)
- func GitBranch(dir string) (branch string, err error)
- func GitCommitted(dir string) (result bool, err error)
- func GitRevision(dir string) (rev string, err error)
- func InSlice(slice interface{}, needle interface{}) (result bool, err error)
- func IsNil(i interface{}) bool
- func ParseAccessTokens(s []byte, token AccessToken)
- func ParseFlags(i interface{}, defaultMap map[string]string) (err error)
- func Prettify(obj interface{}) string
- func RandomString(i int) string
- func RandomStringFrom(chars string, i int) string
- func ReflectCopy(source, destinationPointer interface{})
- func Stack() string
- func StripStack(err error) (result error)
- func ToCurl(req *http.Request) string
- func UpdateGitRevision(dir, destination string) (err error)
- func ValidateFuncInput(f interface{}, in []reflect.Type) error
- func ValidateFuncInputs(f interface{}, ins ...[]reflect.Type) (errs []error)
- func ValidateFuncOutput(f interface{}, out []reflect.Type) error
- func ValidateFuncOutputs(f interface{}, outs ...[]reflect.Type) (errs []error)
- type AccessToken
- type Base64String
- type ByteString
- type DefaultStackError
- type MultiError
- type Parallelizer
- type StackError
- type SyncLock
- type Time
- type WaitOnce
Constants ¶
const ( NonConfusingCharacters = "23456789ABCDEFGHJKLMNPRSTUVWXYZ" NonConfusingCharactersSoftPair = "ABCDEFGHJLMNOPRSTUVWYZ" )
const ( ISO8601DayTimeFormat = "150405" ISO8601DateTimeFormat = "20060102150405" ISO8601DateFormat = "20060102" )
Variables ¶
This section is empty.
Functions ¶
func CamelToSnake ¶
func ConstantTimeEqualBytes ¶
func ConstantTimeEqualString ¶
func DecodeBigInt ¶
func DecodeBytes ¶
func EncodeBytes ¶
func EncodeToken ¶
func EncodeToken(token AccessToken, timeout time.Duration) (result string, err error)
func GenerateFlags ¶
GenerateFlags will generate command line flags matching the fields of the provided interface (being a struct pointer).
Any fields tagged with `flag` will be named like the value of the `flag` tag.
func GitCommitted ¶
func GitRevision ¶
func ParseAccessTokens ¶
func ParseAccessTokens(s []byte, token AccessToken)
func ParseFlags ¶
ParseFlags will parse command line flags according the fields of the provided interface (being a struct pointer).
It supports bool, int and string fields, and the flag name will be taken from the field name (or the `flag` tag if present).
`flag_default` tags will provide default values if no flag is provided.
func RandomString ¶
func RandomStringFrom ¶
func ReflectCopy ¶
func ReflectCopy(source, destinationPointer interface{})
func StripStack ¶
func ToCurl ¶
For debugging use. Converts a http.Request to a curl string for copy'n'paste to terminal
func UpdateGitRevision ¶
func ValidateFuncInput ¶
func ValidateFuncInputs ¶
func ValidateFuncOutput ¶
func ValidateFuncOutputs ¶
Types ¶
type AccessToken ¶
func ParseAccessToken ¶
func ParseAccessToken(d string, dst AccessToken) (result AccessToken, err error)
ParseAccessToken will return the AccessToken encoded in d. If dst is provided it will encode into it.
type Base64String ¶
type Base64String string
func (Base64String) Bytes ¶
func (self Base64String) Bytes() (result []byte, err error)
func (Base64String) MarshalJSON ¶
func (self Base64String) MarshalJSON() (result []byte, err error)
func (Base64String) String ¶
func (self Base64String) String() string
func (*Base64String) UnmarshalJSON ¶
func (self *Base64String) UnmarshalJSON(b []byte) (err error)
type ByteString ¶
type ByteString struct {
Bytes []byte
}
func (ByteString) MarshalJSON ¶
func (self ByteString) MarshalJSON() ([]byte, error)
func (ByteString) String ¶
func (self ByteString) String() string
func (*ByteString) UnmarshalJSON ¶
func (self *ByteString) UnmarshalJSON(b []byte) error
type DefaultStackError ¶
func (DefaultStackError) Error ¶
func (self DefaultStackError) Error() string
func (DefaultStackError) GetStack ¶
func (self DefaultStackError) GetStack() string
type MultiError ¶
type MultiError []error
func (MultiError) Error ¶
func (self MultiError) Error() string
type Parallelizer ¶
type Parallelizer struct {
// contains filtered or unexported fields
}
func (*Parallelizer) Start ¶
func (self *Parallelizer) Start(f func() error)
func (*Parallelizer) Wait ¶
func (self *Parallelizer) Wait() (err error)
type StackError ¶
func Errorf ¶
func Errorf(f string, args ...interface{}) StackError
func NewError ¶
func NewError(source error) StackError
Directories ¶
Path | Synopsis |
---|---|
Package json implements encoding and decoding of JSON objects as defined in RFC 4627.
|
Package json implements encoding and decoding of JSON objects as defined in RFC 4627. |