Documentation
¶
Index ¶
- func BuildExtractorChain(extractors []string) string
- func ExtractCommentAndValue(line string) (value, comment string)
- func FormatFieldWithComment(indent, fieldName, value, comma, comment, newline string) string
- func GetBaseIdent(expr ast.Expr) *ast.Ident
- func IterateConfigBlocks(content string, pattern *regexp.Regexp, processor func(string) string) string
- func MigrateAddMethod(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateAppTestConfig(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateBasicauthAuthorizer(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateBasicauthConfig(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateBasicauthStorePassword(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateCORSConfig(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateCSRFConfig(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateCacheConfig(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateClientUsage(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateConfigListenerFields(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateContextMethods(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateContribPackages(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateEncryptcookieConfig(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateEnvVarConfig(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateFilesystemMiddleware(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateGenericHelpers(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateHandlerSignatures(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateHealthcheckConfig(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateJWTExtractor(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateKeyAuthConfig(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateLimiterConfig(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateListenMethods(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateListenerCallbacks(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateLoggerGenerics(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateLoggerTags(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateMiddlewareLocals(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateMimeConstants(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateMonitorImport(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateMount(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateParserMethods(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigratePasetoExtractor(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateProxyTLSConfig(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateRedirectMethods(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateReqHeaderParser(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateSendFileConfig(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateSessionConfig(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateSessionExtractor(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateSessionRelease(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateSessionStore(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateShutdownHook(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateStaticRoutes(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateStorageVersions(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateSwaggerPackages(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateTimeoutConfig(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateTrustedProxyConfig(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateUtilsImport(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func MigrateViewBind(cmd *cobra.Command, cwd string, _, _ *semver.Version) error
- func SetContribV3VersionFetcher(fn func(string) (string, error)) func()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildExtractorChain ¶ added in v0.9.0
BuildExtractorChain builds an extractor expression from a slice of extractors. Returns a single extractor for one element, Chain() for multiple, or empty for none.
func ExtractCommentAndValue ¶ added in v0.9.0
ExtractCommentAndValue separates a value from its trailing comment. It handles both line comments (//) and block comments (/* */). Returns the value (trimmed) and the comment (with original delimiters).
func FormatFieldWithComment ¶ added in v0.9.0
FormatFieldWithComment formats a field assignment with consistent spacing for indentation, value, comma, comment, and newline.
func GetBaseIdent ¶ added in v0.9.0
GetBaseIdent recursively resolves an expression to its base identifier. It handles selector expressions, call expressions, and identifiers. Returns nil if the expression cannot be resolved to a simple identifier.
func IterateConfigBlocks ¶ added in v0.9.0
func IterateConfigBlocks(content string, pattern *regexp.Regexp, processor func(string) string) string
IterateConfigBlocks finds all occurrences matching the given regex pattern, extracts their config blocks using braces, processes each block with the provided function, and reconstructs the content.
func MigrateAddMethod ¶
func MigrateAppTestConfig ¶
func MigrateBasicauthAuthorizer ¶ added in v0.2.0
func MigrateBasicauthConfig ¶ added in v0.2.0
func MigrateBasicauthStorePassword ¶ added in v0.2.0
func MigrateCORSConfig ¶
func MigrateCSRFConfig ¶
func MigrateCacheConfig ¶ added in v0.2.0
func MigrateClientUsage ¶ added in v0.10.0
func MigrateContextMethods ¶
func MigrateContribPackages ¶ added in v0.8.0
MigrateContribPackages updates imports and module requirements that reference github.com/gofiber/contrib to use the v3 module path.
func MigrateEncryptcookieConfig ¶ added in v0.7.0
func MigrateEnvVarConfig ¶
func MigrateGenericHelpers ¶
func MigrateJWTExtractor ¶ added in v0.9.0
func MigrateKeyAuthConfig ¶ added in v0.2.0
func MigrateLimiterConfig ¶
func MigrateListenMethods ¶
func MigrateLoggerGenerics ¶ added in v0.5.0
func MigrateLoggerTags ¶
func MigrateMiddlewareLocals ¶
func MigrateMimeConstants ¶
func MigrateMonitorImport ¶
func MigrateParserMethods ¶
func MigratePasetoExtractor ¶ added in v0.9.0
func MigrateProxyTLSConfig ¶
func MigrateRedirectMethods ¶
func MigrateReqHeaderParser ¶
func MigrateSendFileConfig ¶ added in v0.8.0
func MigrateSessionConfig ¶
func MigrateSessionExtractor ¶ added in v0.2.0
func MigrateSessionRelease ¶ added in v0.10.0
MigrateSessionRelease adds defer sess.Release() after store.Get() calls when using the Store Pattern (legacy pattern). This is required in v3 for manual session lifecycle management.
Only the following Store methods return *Session from the pool and require Release():
- store.Get(c fiber.Ctx) (*Session, error)
- store.GetByID(ctx context.Context, id string) (*Session, error)
Middleware handlers do NOT require Release() as the middleware manages the lifecycle.
This migration parses the Go AST and uses source-level heuristics to identify session.Store.Get/GetByID calls on variables initialized via session.NewStore(), including support for custom import aliases. It does not currently track stores that are passed via parameters, returned from functions, or stored in structs.
func MigrateSessionStore ¶ added in v0.4.0
MigrateSessionStore updates session.New assignments to session.NewStore.
func MigrateShutdownHook ¶ added in v0.2.0
func MigrateStaticRoutes ¶
func MigrateStorageVersions ¶ added in v0.10.0
MigrateStorageVersions updates storage package imports to use the correct latest version. This migration handles storage packages from github.com/gofiber/storage/*.
func MigrateSwaggerPackages ¶ added in v0.9.0
func MigrateTimeoutConfig ¶ added in v0.2.0
func MigrateUtilsImport ¶ added in v0.4.0
func MigrateViewBind ¶
func SetContribV3VersionFetcher ¶ added in v0.9.0
SetContribV3VersionFetcher overrides the function used to fetch contrib module versions. It resets the cached versions and returns a restore function to revert the change.
Types ¶
This section is empty.
Source Files
¶
- add_method.go
- app_test_config.go
- basicauth_authorizer.go
- basicauth_config.go
- basicauth_store_password.go
- cache_config.go
- client_usage.go
- common.go
- config_listener_fields.go
- context_methods.go
- contrib_packages.go
- contrib_versions.go
- corsconfig.go
- csrfconfig.go
- encryptcookie_config.go
- env_var_config.go
- filesystem_middleware.go
- generic_helpers.go
- handler_signatures.go
- healthcheck_config.go
- jwt_extractor.go
- key_auth_config.go
- limiter_config.go
- listen_methods.go
- listener_callbacks.go
- logger_generics.go
- logger_tags.go
- middleware_locals.go
- mime_constants.go
- monitor_import.go
- mount.go
- parser_methods.go
- paseto_extractor.go
- proxy_tlsconfig.go
- redirect_methods.go
- req_header_parser.go
- sendfile_config.go
- session_config.go
- session_extractor.go
- session_release.go
- session_store.go
- shutdown_hook.go
- static_routes.go
- storage_versions.go
- swagger_packages.go
- timeout_config.go
- trusted_proxy_config.go
- utils_import.go
- view_bind.go