utils

package
v1.0.19 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindGoMod

func FindGoMod(startPath string, module string) (string, error)

FindGoMod searches upwards from the given path for a go.mod file

func First

func First[S ~[]E, E any](s S, f func(E) bool) (E, error)

func IsComplexType added in v1.0.5

func IsComplexType(typ string) bool

Is the type a non-simple type?

func IsSimpleType added in v1.0.5

func IsSimpleType(t string) bool

Is the type a simple, built-in type?

func Map

func Map[S ~[]E, E any, R any](s S, f func(E) R) []R

func MapPointers

func MapPointers[S ~[]*R, R any](s S) []R

func ParseGoalesceTagSettings added in v1.0.5

func ParseGoalesceTagSettings(tag string) (map[string]string, error)

Parse goalesce settings from a field's tag

func StripModulePackage

func StripModulePackage(s, moduleName string) string

func ToCamelCase

func ToCamelCase(s string) string

Convert the string to camelCase.

func ToHtmlCase

func ToHtmlCase(s string) string

Convert the string to html-case.

func ToPascalCase

func ToPascalCase(s string) string

Convert the string to PascalCase.

func ToSnakeCase

func ToSnakeCase(s string) string

Convert the string to snake_case.

Types

type OpenApiType added in v1.0.5

type OpenApiType struct {
	Type     string
	Ref      *string
	Items    *map[string]string
	Format   *string
	Nullable bool
}

Metadata for generating an OpenAPI field

func ToOpenApiType added in v1.0.5

func ToOpenApiType(typ string) *OpenApiType

TODO(joeriddles): Refactor this monstrosity

func (*OpenApiType) IsSimpleType added in v1.0.17

func (o *OpenApiType) IsSimpleType() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳