utils

package
v0.0.0-...-183fc37 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelCaseToSnakeCase

func CamelCaseToSnakeCase(s string) string

AI Generated

func CamelCaseToTitleCase

func CamelCaseToTitleCase(str string) string

func DashCaseToTitleCase

func DashCaseToTitleCase(str string) string

func NewCodeBlock

func NewCodeBlock(lines ...string) *codeBlock

func SnakeCaseToCamelCase

func SnakeCaseToCamelCase(str string) string

func TitleCaseToSnakeCase

func TitleCaseToSnakeCase(s string) string

func ToTitleCase

func ToTitleCase(s string) string

Types

type FileWriter

type FileWriter interface {
	Write() error
}

type GoConstraintInterface

type GoConstraintInterface struct {
	Name        string
	Description string
	Items       []string
}

func NewGoConstraintInterface

func NewGoConstraintInterface(name, description string) *GoConstraintInterface

func (*GoConstraintInterface) AddItem

func (g *GoConstraintInterface) AddItem(item string)

func (*GoConstraintInterface) Write

func (g *GoConstraintInterface) Write() (string, error)

type GoFile

type GoFile struct {
	PackageName string
	Name        string
	Imports     []string
	Contents    *codeBlock
}

func NewGoFile

func NewGoFile(packageName, name string, imports []string, contents *codeBlock) GoFile

func (GoFile) Write

func (g GoFile) Write() error

type GoStruct

type GoStruct struct {
	Name        string
	Description string
	Items       *orderedmap.OrderedMap
}

func NewGoStruct

func NewGoStruct(name, description string, items []GoStructItem) *GoStruct

func (*GoStruct) AddItem

func (g *GoStruct) AddItem(key, val, tagName, description string, isPointer bool)

func (GoStruct) Write

func (g GoStruct) Write() (string, error)

type GoStructItem

type GoStructItem struct {
	Name        string
	Description string
	Value       string
	Pointer     bool
	TagName     string
}

type OrderedMap

type OrderedMap[T any] struct {
	// contains filtered or unexported fields
}

func NewOrderedMap

func NewOrderedMap[T any](data map[string]T) *OrderedMap[T]

func (*OrderedMap[T]) Get

func (o *OrderedMap[T]) Get(key string) (T, error)

func (*OrderedMap[T]) Keys

func (o *OrderedMap[T]) Keys() []string

func (*OrderedMap[T]) Set

func (o *OrderedMap[T]) Set(key string, item T)

func (*OrderedMap[T]) SortKeys

func (o *OrderedMap[T]) SortKeys()

type PythonClass

type PythonClass struct {
	Name        string
	Description string
	Items       []PythonClassItem
}

func NewPythonClass

func NewPythonClass(name, description string) *PythonClass

func (*PythonClass) AddItem

func (p *PythonClass) AddItem(name, value, constructorName, alias, description string, required, isObjectArray bool)

func (PythonClass) HasAsync

func (p PythonClass) HasAsync() bool

func (PythonClass) HasIf

func (p PythonClass) HasIf() bool

func (PythonClass) HasWith

func (p PythonClass) HasWith() bool

func (PythonClass) Write

func (p PythonClass) Write() (string, error)

func (PythonClass) WriteTypedDict

func (p PythonClass) WriteTypedDict() (string, error)

type PythonClassItem

type PythonClassItem struct {
	Name            string
	Description     string
	Alias           string
	Value           string
	ConstructorName string
	Required        bool
	IsObjectArray   bool
}

type PythonFile

type PythonFile struct {
	Name     string
	Contents *codeBlock
}

func NewPythonFile

func NewPythonFile(
	name string,
	contents *codeBlock,
) PythonFile

func (PythonFile) Write

func (p PythonFile) Write() error

Jump to

Keyboard shortcuts

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