util

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Repeated = "repeated "
)

Variables

This section is empty.

Functions

func CleanString

func CleanString(s string) string

CleanString deletes spaces, '-' and '/'.

func GetFieldNumber added in v0.1.6

func GetFieldNumber(deterministicFieldNumbers bool, counter int, input ...string) (int, int)

GetFieldNumber returns a "consistent" field number for the proto field based on the input strings if deterministicFieldNumbers is true, otherwise it returns the incremented counter input (ascending field numbers). The maximum field number is 18999. The first return value is the field number and the second is the counter i

func GetProtoType added in v0.0.3

func GetProtoType(s string) string

GetProtoType converts Ontology type to golang type

func SortMapKeys added in v0.0.5

func SortMapKeys[V any](m map[string]V) []string

SortMapKeys returns the keys of the map sorted ba sort.Strings.

func ToPlural added in v0.1.6

func ToPlural(s string) string

ToPlural returns the plural of a string

func ToSnakeCase

func ToSnakeCase(s string) string

ToSnakeCase converts camel case to snake case and deletes spaces

func WriteFile added in v0.1.6

func WriteFile(outputFile, s string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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