type CR3Call struct {
// contains filtered or unexported fields
}
func New(module_namager_url string) *CR3Call
New creates a new instance of CR3Call with the given module_namager_url.
Parameters: - module_namager_url: The URL of the module manager.
Returns: - *CR3Call: A pointer to the newly created CR3Call instance.
func (c *CR3Call) Call(module_name, submodule_name string, data CR3CallData, use_module_manager_url bool) (hctypes.Dict, error)
Call performs a HTTP request based on the provided module name, submodule name, and data.
Parameters: - module_name: The name of the module. - submodule_name: The name of the submodule. - data: The data for the HTTP request. - use_module_manager_url: If true then use mocule manager url, if false then use microservice url Returns: - hctypes.Dict: The result of the HTTP request. - error: An error if the request fails.
func (c *CR3Call) GetAPI(module_name, submodule_name string) (string, *config.ConfigAPI, error)
GetAPI retrieves the API configuration for a given module and submodule.
Parameters: - module_name: The name of the module. - submodule_name: The name of the submodule.
Returns: - string: The URL of the API. - *config.ConfigAPI: The API configuration. - error: An error if the API configuration cannot be retrieved.
func (c *CR3Call) GetApis(module_name string) ([]string, []string, error)
GetApis retrieves the APIs and pages for a given module.
Parameters: - module_name: The name of the module. Returns: - []string: The list of APIs. - []string: The list of pages. - error: An error if the APIs and pages cannot be retrieved.
func (c *CR3Call) GetConfig(module_name, submodule_name string) (*EndpointConfig, error)
GetConfig retrieves the configuration for a given module and submodule.
Parameters: - module_name: The name of the module. - submodule_name: The name of the submodule.
Returns: - *EndpointConfig: A pointer to the EndpointConfig struct representing the configuration, or nil if an error occurs. - error: An error if the configuration cannot be retrieved.
func (c *CR3Call) GetNamespaces() ([]string, error)
GetNamespaces retrieves the namespaces from the module manager.
Returns: - []string: The list of namespaces. - error: An error if the namespaces cannot be retrieved.
func (c *CR3Call) GetPage(module_name, submodule_name string) (string, error)
GetPage retrieves the page URL based on the module and submodule names.
Parameters: - module_name: The name of the module. - submodule_name: The name of the submodule. Returns: - string: The URL of the page. - error: An error if the page URL cannot be retrieved.
type CR3CallData struct { URLQuery hctypes.Dict URLParams hctypes.Dict Params hctypes.Dict Headers hctypes.Dict }
type EndpointConfig struct { Type string `json:"type,omitempty"` Url string `json:"url,omitempty"` Api *config.ConfigAPI `json:"api,omitempty"` Template *config.ConfigTemplate `json:"template,omitempty"` }