util

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DisableYAMLMarshalComments = false

DisableYAMLMarshalComments controls MarshalYAMLWithDescriptions

Functions

func IndentLines

func IndentLines(lines []string, char string, count int) []string

IndentLines indents all the lines with spaces

func MarshalYAMLWithDescriptions

func MarshalYAMLWithDescriptions(val interface{}) (interface{}, error)

MarshalYAMLWithDescriptions provides marshaling structs with Repose descriptions.

Make sure the value (pointer receiver is fine) you pass in doesn't implement YAML Marshaler, otherwise YAML will get into a Marshal() loop.

func MustMarshalYAML

func MustMarshalYAML(i interface{}) []byte

func MustParseInt

func MustParseInt(number string) int

MustParseInt uses Atoi to create int from the given argument, and panics if there is an error.

func ParamStyleToBraces

func ParamStyleToBraces(path string) string

ParamStyleToBraces converts the params in the string from style :param to {param}

func ParamStyleToColon

func ParamStyleToColon(path string) string

ParamStyleToColon converts the params in the string from style {param} to :param

func ToGoName

func ToGoName(name string) (should string)

ToGoName returns a name that matches Go conventions. Taken function "lintName" from Go lint. Also added casing transform.

Types

This section is empty.

Directories

Path Synopsis
gen
Package gen contains (mostly) generated Jennifer code, that can be used at multiple places.
Package gen contains (mostly) generated Jennifer code, that can be used at multiple places.

Jump to

Keyboard shortcuts

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