bridge

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: LGPL-2.1 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(configObj ConfigObj) ([]byte, error)

func GenerateHTTPDefaults

func GenerateHTTPDefaults(configObj ConfigObj) ([]byte, error)

func GenerateOpenAPIJSON

func GenerateOpenAPIJSON(configObj ConfigObj) ([]byte, error)

func RunOgen

func RunOgen(configObj OgenConfigObj) error

func ValidateMappings

func ValidateMappings(documentMap map[string]any, requireFlag bool) error

ValidateMappings checks x-func mappings before the expensive generation step.

Types

type ConfigObj

type ConfigObj struct {
	OgenDir          string
	PackageName      string
	Document         map[string]any
	RequireXFunc     bool
	Comments         bool
	OpenAPIJSON      []byte
	HasOpenAPIJSON   bool
	ServerOptionName string
}

type FieldObj

type FieldObj struct {
	Name  string
	Type  string
	Named bool
}

type MappingObj

type MappingObj struct {
	OperationFuncMap map[string]string
	SecurityFuncMap  map[string]string
	FuncDocMap       map[string]funcDocObj
	MissingArr       []string
}

type MethodObj

type MethodObj struct {
	Name      string
	ParamArr  []FieldObj
	ResultArr []FieldObj
}

type OgenConfigObj

type OgenConfigObj struct {
	Context     context.Context
	Command     string
	InputPath   string
	TargetDir   string
	PackageName string
	Timeout     time.Duration
	Force       bool
}

type ParseResultObj

type ParseResultObj struct {
	HandlerInterfaceName  string
	SecurityInterfaceName string
	ServerOptionName      string
	HandlerMethodArr      []MethodObj
	SecurityMethodArr     []MethodObj
	ImportMap             map[string]string
	StructFieldMap        map[string]map[string]StructFieldObj
}

type RenderMethodObj

type RenderMethodObj struct {
	MethodObj MethodObj
	FuncName  string
	UseCall   bool
	NeedError bool
}

type StructFieldObj

type StructFieldObj struct {
	Name string
	Type string
}

Jump to

Keyboard shortcuts

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