class
Analyzer::Go::GoRestful
- Analyzer::Go::GoRestful
- Analyzer::Go::GoEngine
- Analyzer
- Reference
- Object
Overview
go-restful (github.com/emicklei/go-restful) — a WebService-centric
router used across the cloud-native ecosystem (Kubernetes' apiserver,
Harbor, …). Routes are a nested builder chain hung off a WebService
whose Path() supplies the prefix:
ws := new(restful.WebService) ws.Path("/users") ws.Route(ws.GET("/{user-id}").To(u.findUser). Param(ws.PathParameter("user-id", "identifier")). Reads(User{}))
The extractor resolves the full mounted path and the self-declared params; this analyzer wires endpoints, params, and 1-hop callees.
Defined in:
analyzer/analyzers/go/go_restful.crConstant Summary
-
IMPORT_MARKER =
"github.com/emicklei/go-restful"
Instance Method Summary
- #analyze
-
#normalize_restful_path(path : String) : String
go-restful path params are
{name}, with an optional tail/regex constraint{name:*}/{name:[0-9]+}; strip the constraint so the template reads as a clean{name}(mirrors the Iris normalizer).
Instance methods inherited from class Analyzer::Go::GoEngine
add_param_to_endpoint(param : Param, endpoint : Endpoint)
add_param_to_endpoint,
add_static_path_if_valid(static_path : Hash(String, String), public_dirs : Array(Hash(String, String)))
add_static_path_if_valid,
collect_import_path_function_bodies(package_function_bodies : Hash(String, Hash(String, Noir::GoCalleeExtractor::FunctionBody))) : Hash(String, Hash(String, Noir::GoCalleeExtractor::FunctionBody))
collect_import_path_function_bodies,
collect_import_path_method_bodies(package_method_bodies : Hash(String, Hash(String, Array(Noir::GoCalleeExtractor::FunctionBody)))) : Hash(String, Hash(String, Array(Noir::GoCalleeExtractor::FunctionBody)))
collect_import_path_method_bodies,
collect_package_controller_method_bodies(file_contents : Hash(String, String)) : Hash(String, Hash(String, Array(Noir::GoCalleeExtractor::FunctionBody)))
collect_package_controller_method_bodies,
collect_package_controller_methods(file_contents : Hash(String, String)) : Hash(String, Hash(String, Array(String)))
collect_package_controller_methods,
collect_package_function_bodies(file_contents : Hash(String, String)) : Hash(String, Hash(String, Noir::GoCalleeExtractor::FunctionBody))
collect_package_function_bodies,
collect_package_groups_ts(group_method : String = "Group", import_marker : String | Nil = nil) : Tuple(Hash(String, Hash(String, String)), Hash(String, String))
collect_package_groups_ts,
framework_package_dirs(file_contents : Hash(String, String), import_marker : String) : Set(String)
framework_package_dirs,
framework_route_source_candidate?(content : String, dir : String, framework_dirs : Set(String), import_marker : String, extra_methods : Array(String)) : Bool
framework_route_source_candidate?,
go_route_source_candidate?(content : String, extra_methods : Array(String)) : Bool
go_route_source_candidate?,
read_package_file_contents : Hash(String, String)
read_package_file_contents,
resolve_public_dirs(public_dirs : Array(Hash(String, String)))
resolve_public_dirs,
resolve_public_dirs_with_glob(public_dirs : Array(Hash(String, String)))
resolve_public_dirs_with_glob,
static_dir_entry(source_path : String, static_path : String, file_path : String) : Hash(String, String)
static_dir_entry,
ts_controller_method_bodies_for_directory(package_controller_method_bodies : Hash(String, Hash(String, Array(Noir::GoCalleeExtractor::FunctionBody))), dir : String) : Hash(String, Array(Noir::GoCalleeExtractor::FunctionBody))
ts_controller_method_bodies_for_directory,
ts_controller_methods_for_directory(package_controller_methods : Hash(String, Hash(String, Array(String))), dir : String) : Hash(String, Array(String))
ts_controller_methods_for_directory,
ts_function_bodies_for_directory(package_function_bodies : Hash(String, Hash(String, Noir::GoCalleeExtractor::FunctionBody)), dir : String) : Hash(String, Noir::GoCalleeExtractor::FunctionBody)
ts_function_bodies_for_directory,
ts_groups_for_directory(package_groups : Hash(String, Hash(String, String)), dir : String) : Hash(String, String)
ts_groups_for_directory
Class methods inherited from class Analyzer::Go::GoEngine
go_test_file?(path : String) : Bool
go_test_file?
Instance methods inherited from class Analyzer
analyze
analyze,
base_path : String
base_path,
base_paths : Array(String)
base_paths,
callees_needed? : Bool
callees_needed?,
logger : NoirLogger
logger,
parallel_analyze(files : Array(String), &block : String -> Nil)
parallel_analyze,
read_file_content(path : String) : String
read_file_content,
result : Array(Endpoint)
result,
url : String
url
Constructor methods inherited from class Analyzer
new(options : Hash(String, YAML::Any))
new
Macros inherited from class Analyzer
define_getter_methods(names)
define_getter_methods
Instance methods inherited from module FileHelper
all_files : Array(String)
all_files,
get_files_by_extension(extension : String) : Array(String)
get_files_by_extension,
get_files_by_prefix(prefix : String) : Array(String)
get_files_by_prefix,
get_files_by_prefix_and_extension(prefix : String, extension : String) : Array(String)
get_files_by_prefix_and_extension,
get_public_dir_files(base_path : String, folder : String) : Array(String)
get_public_dir_files,
get_public_files(base_path : String, anchors : Array(String) = ["shard.yml", "Gemfile"]) : Array(String)
get_public_files
Instance Method Detail
go-restful path params are {name}, with an optional tail/regex
constraint {name:*} / {name:[0-9]+}; strip the constraint so the
template reads as a clean {name} (mirrors the Iris normalizer).