internal

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Example (CalcAllow)
str := []byte("FooBAR")

fmt.Println(calcAlloc(str))
Output:

7

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOperationToDocument

func AddOperationToDocument(doc *openapi.Document, path string, op *openapi.Operation) (err error)

func Caller added in v0.6.0

func Caller(skip int) *runtime.Func

func CallerName

func CallerName(skip int) string
Example
fmt.Println(CallerName(0))
Output:

ExampleCallerName

func CallerNameFromFunc added in v0.6.0

func CallerNameFromFunc(f *runtime.Func) string

func CallerType

func CallerType(skip int) string

func CallerTypeFromFunc added in v0.6.0

func CallerTypeFromFunc(f *runtime.Func) string

func EqualStructs

func EqualStructs[A, B any]() bool

func IsPublicType added in v0.7.2

func IsPublicType(typ reflect.Type) bool

func Must

func Must[T any](v T, err error) T

Panics if err != nil.

func ParseBytes added in v0.18.0

func ParseBytes(s string) (int64, error)
Example
values := []string{"512", "1kb", "2MB", "1.5GiB", "3pb"}
for _, v := range values {
	n, err := ParseBytes(v)
	if err != nil {
		fmt.Println("error:", err)
		continue
	}
	fmt.Println(n)
}
Output:

512
1024
2097152
1610612736
3377699720527872

func ParseName

func ParseName(s string) (title, operationId string)
Example
str := "FooBarBazASD_haha"

fmt.Println(ParseName(str))
Output:

Foo bar baz ASD haha foo-bar-baz-asd-haha

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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