Versions in this module Expand all Collapse all v1 v1.23.10 Mar 20, 2024 v1.23.9 Mar 8, 2024 Changes in this version type MethodInfo + func (m *MethodInfo) Id() string v1.23.8 Mar 8, 2024 v1.23.7 Mar 8, 2024 v1.23.6 Mar 8, 2024 v1.23.5 Mar 6, 2024 v1.23.4 Mar 6, 2024 Changes in this version + func Collector(rootPath string) map[string]MethodInfo + func ExtraMethodAndName(testString string) (string, string, error) + func ParseAndStoreMethods(filename string) map[string]MethodInfo + type MethodInfo struct + FileName string + Line int + MethodName string + MethodReceiver string + PkgName string type Service + AstMethodInfo map[string]MethodInfo v1.23.3 Mar 6, 2024 v1.23.2 Mar 6, 2024 v1.23.1 Mar 6, 2024 Changes in this version + var AcceptedTypes = []string + var ErrConfigNotFound = errors.New("config not found") + var ErrConfigPortRequired = errors.New("config port is required") + var ErrInputModeNotFound = errors.New("input mode not found") + var ErrOutputDirectoryPathRequired = errors.New("output directory path is required") + var ErrOutputFilePathRequired = errors.New("output file path is required") + var ErrOutputModeNotFound = errors.New("output mode not found") + var PredefinedTypeMap = map[string]TypeFormat + func BindingTagToContentTypes(bindingTag astTraversal.BindingTagType) []string + func Contains[S ~[]E, E comparable](s S, v E) bool + func ContentTypeToBindingTag(contentType string) astTraversal.BindingTagType + func ExtractBindingTags(fields map[string]Field) (bindingTags []astTraversal.BindingTagType, uniqueBindings bool) + func Index[S ~[]E, E comparable](s S, v E) int + func IsAcceptedType(t string) bool + type BodyParam struct + ContentType string + Field Field + IsArray bool + IsBound bool + IsMap bool + IsRequired bool + Name string + type CLIMode string + const CLIModeBuilder + const CLIModeNone + const CLIModeSetup + type Config struct + BasePath string + Contact Contact + Description string + Host string + License License + Port int + Secure bool + Title string + Version string + func (c *Config) Validate() error + type ConfigBuilder struct + func NewConfigBuilder() *ConfigBuilder + func (c *ConfigBuilder) Build() (*Config, error) + func (c *ConfigBuilder) SetBasePath(basePath string) *ConfigBuilder + func (c *ConfigBuilder) SetContact(contact Contact) *ConfigBuilder + func (c *ConfigBuilder) SetDescription(description string) *ConfigBuilder + func (c *ConfigBuilder) SetHost(host string) *ConfigBuilder + func (c *ConfigBuilder) SetLicense(license License) *ConfigBuilder + func (c *ConfigBuilder) SetPort(port int) *ConfigBuilder + func (c *ConfigBuilder) SetSecure(secure bool) *ConfigBuilder + func (c *ConfigBuilder) SetTitle(title string) *ConfigBuilder + func (c *ConfigBuilder) SetVersion(version string) *ConfigBuilder + type Contact struct + Email string + Name string + URL string + type ContextFuncBuilder struct + Route *Route + Traverser *astTraversal.CallExpressionTraverser + func NewContextFuncBuilder(route *Route, traverser *astTraversal.CallExpressionTraverser) *ContextFuncBuilder + func (c *ContextFuncBuilder) Build(mapper func(*Route, []any) (*Route, error)) (*Route, error) + func (c *ContextFuncBuilder) ExpressionResult() *ContextFuncBuilder + func (c *ContextFuncBuilder) Ignored() *ContextFuncBuilder + func (c *ContextFuncBuilder) StatusCode() *ContextFuncBuilder + func (c *ContextFuncBuilder) Value() *ContextFuncBuilder + type CustomFunc func(contextVarName string, contextFuncBuilder *ContextFuncBuilder) (*Route, error) + type Field struct + ArrayLength int64 + ArrayType string + Doc string + EnumValues []any + IsEmbedded bool + IsRequired bool + MapKeyPackage string + MapKeyType string + MapValueType string + Name string + Package string + SliceType string + StructFieldBindingTags astTraversal.BindingTagMap + StructFieldValidationTags astTraversal.ValidationTagMap + StructFields map[string]Field + Type string + func AddComponent(prev []Field, n ...Field) []Field + func ParseResultToField(result astTraversal.Result) Field + type IOConfiguration map[IOConfigurationKey]any + type IOConfigurationKey string + const IOConfigurationKeyDirectoryPath + const IOConfigurationKeyFilePath + type Input struct + CreateRoutes ServiceFunction + Mode InputMode + ParseRoutes ServiceFunction + type InputMode string + type License struct + Name string + URL string + type Option func(*Service) + func WithConfig(config *Config) Option + func WithCustomFunc(customFunc CustomFunc) Option + func WithCustomLogLevel(level string) Option + func WithCustomLogger(logger zerolog.Logger) Option + func WithCustomTypeMapping(customTypeMap map[string]TypeFormat) Option + func WithCustomTypeMappingSingle(key string, valueType string, valueFormat string) Option + func WithCustomWorkDir(wd string) Option + func WithPathDenyList(denyList string) Option + func WithPathDenyListFunc(denyList func(string) bool) Option + func WithPathDenyListRegex(regex *regexp.Regexp) Option + type Output struct + Configuration IOConfiguration + Generate ServiceFunction + Mode OutputMode + type OutputMode string + type Param struct + Field Field + IsArray bool + IsBound bool + IsMap bool + IsRequired bool + Name string + type Processable struct + Name string + Pkg string + type ReturnType struct + ContentType string + Field Field + StatusCode int + func AddReturnType(prev []ReturnType, n ...ReturnType) []ReturnType + type Route struct + Body []BodyParam + Doc string + File string + Handler string + LineNo int + Method string + OperationID string + Path string + PathParams []Param + QueryParams []Param + RequestHeaders []Param + ResponseHeaders []Param + ReturnTypes []ReturnType + type Service struct + CLIMode CLIMode + CacheEnabled bool + CachePath string + Components []Field + Config *Config + CustomFuncs []CustomFunc + CustomTypeMapping map[string]TypeFormat + Inputs []Input + Log zerolog.Logger + Outputs []Output + PathDenyList []func(string) bool + Routes []Route + WorkDir string + func New(opts ...Option) *Service + func (s *Service) AddRoute(route Route) + func (s *Service) Cache() error + func (s *Service) Clean() error + func (s *Service) ClearCache() error + func (s *Service) CompleteParse() error + func (s *Service) CreateRoutes() error + func (s *Service) Generate() error + func (s *Service) GetMainPackageName() (string, error) + func (s *Service) GetTypeMapping(key string, pkg string) (TypeFormat, bool) + func (s *Service) HandleSubstituteTypes(component *Field) + func (s *Service) LoadCache() error + func (s *Service) LoadCacheFromCustomPath(cachePath string) error + func (s *Service) MoveTempOutputDir(dirPath, outputDir string) error + func (s *Service) Parse() error + func (s *Service) ParseRoutes() error + func (s *Service) ReplaceRoute(route Route) + func (s *Service) SetConfig(config *Config) *Service + func (s *Service) Setup() error + func (s *Service) SetupParse() error + func (s *Service) SetupTempOutputDir(dirPath string) (string, error) + func (s *Service) Teardown() error + type ServiceFunction func(service *Service) error + type TypeFormat struct + Format string + Type string