enum

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Framework

type Framework string

Framework represents the detected framework

const (
	// * node frameworks
	Next          Framework = "next"
	Astro         Framework = "astro"
	Vite          Framework = "vite"
	CRA           Framework = "cra"
	Angular       Framework = "angular"
	Remix         Framework = "remix"
	BunFW         Framework = "bun"
	Express       Framework = "express"
	Sveltekit     Framework = "sveltekit"
	Svelte        Framework = "svelte"
	Solid         Framework = "solid"
	Hono          Framework = "hono"
	TanstackStart Framework = "tanstack-start"
	// * python frameworks
	PythonFramework Framework = "python" // Sometimes detected as a framework
	Django          Framework = "django"
	Flask           Framework = "flask"
	FastAPI         Framework = "fastapi"
	FastHTML        Framework = "fasthtml"
	// * GO frameworks
	Gin Framework = "gin"
	// * Java frameworks
	SpringBoot Framework = "spring-boot"
	// * PHP frameworks
	Laravel Framework = "laravel"
	// * Ruby frameworks
	Rails Framework = "rails"
	// * Rust frameworks
	Rocket Framework = "rocket"
	// * not detected
	UnknownFramework Framework = "unknown"
)

func DetectFramework

func DetectFramework(provider Provider, ctx *generate.GenerateContext) Framework

Detect framework based on provider and plan

func (Framework) Schema

func (u Framework) Schema(r huma.Registry) *huma.Schema

Register enum in OpenAPI specification https://github.com/danielgtaylor/huma/issues/621

func (Framework) Values

func (Framework) Values() (kinds []string)

Values provides list valid values for Enum.

type Provider

type Provider string

Provider represents the detected provider

const (
	Node            Provider = "node"
	Deno            Provider = "deno"
	Bun             Provider = "bun"
	Go              Provider = "go"
	Java            Provider = "java"
	PHP             Provider = "php"
	Python          Provider = "python"
	Ruby            Provider = "ruby"
	Rust            Provider = "rust"
	Elixir          Provider = "elixir"
	Staticfile      Provider = "staticfile"
	UnknownProvider Provider = "unknown"
)

func ParseProvider

func ParseProvider(detectedProviders []string) Provider

Parses detected providers into Provider

func (Provider) Schema

func (u Provider) Schema(r huma.Registry) *huma.Schema

Register enum in OpenAPI specification https://github.com/danielgtaylor/huma/issues/621

func (Provider) Values

func (Provider) Values() (kinds []string)

Values provides list valid values for Enum.

Jump to

Keyboard shortcuts

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