This project includes a series of tools and libraries applicable to OpenIM, along with some other project-provided tool supports, aimed at supporting efficient solution development. Below is an introduction to the functionalities of each module:
api2rpc.go
: A tool for converting API to RPC, used for converting HTTP API requests into RPC calls.
format.go
,gin.go
,http.go
,resp.go
: Handles the formatting, encapsulation, and sending of API responses, supporting different web frameworks.
check.go
: Provides service health checks and dependency verification functions.
config.go
,config_parser.go
,config_source.go
,manager.go
,path.go
: Configuration management module, supporting the parsing, loading, and dynamic updating of configurations.validation
: Provides tools and libraries for configuration validation.
mongo
,pagination
,redis
,tx.go
: Database operation-related tools, including support for MongoDB, Redis, and transaction management.
discovery_register.go
: Service discovery and registration functions.zookeeper
: Service discovery implementation based on Zookeeper.
env.go
,env_test.go
: Environment variable management tools, including loading and parsing environment variables.
code.go
,coderr.go
,error.go
,predefine.go
,relation.go
: Error code management and custom error types.
file.go
,path.go
: Utilities for file operations and path generation.- Related test files.
color.go
,encoder.go
,logger.go
,sql_logger.go
,zap.go
,zk_logger.go
: Log management module, supporting multiple log formats and outputs.
Important
For more information about OpenIM log, please read https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/logging.md
ctx.go
: Context management tool, used for passing request-related information between middleware and services.
kafka
: Support for message queues based on Kafka.
gin.go
,intercept_chain.go
,rpc_client_interceptor.go
,rpc_server_interceptor.go
: Middleware and interceptors, used for preprocessing and postprocessing of requests.specialerror
: Special error handling module.
jwt_token.go
,jwt_token_test.go
: JWT token verification and testing.
The utils contain multiple utility libraries, such as encoding
, encrypt
, httputil
, jsonutil
, network
, splitter
, stringutil
, timeutil
: Providing various common functionalities, such as encryption, encoding, network operations, etc.
base64.go
&base64_test.go
: Provides utility functions for Base64 encoding and decoding, and their unit tests.
encryption.go
&encryption_test.go
: Contains functionalities for encryption and decryption, supporting common encryption algorithms, and related unit tests.
jsonutils.go
&jsonutils_test.go
: Provides utility functions for handling JSON data, such as parsing and generating JSON, and related unit tests.
http_client.go
&http_client_test.go
: Encapsulates HTTP client operations, providing convenient methods for sending HTTP requests, and their unit tests.
interface.go
,json.go
&json_test.go
: Focuses on JSON data handling, including more advanced JSON operations and customized JSON parsing methods, and their unit tests.
ip.go
&ip_test.go
: Provides network-related utility functions, such as parsing and validating IP addresses, and related unit tests.
splitter.go
&splitter_test.go
: Provides tools for splitting strings, supporting various splitting strategies and complex splitting scenarios, and their unit tests.
strings.go
&strings_test.go
: Contains a series of utility functions for string operations, such as modifying, searching, comparing strings, and their unit tests.
time_format.go
&time_format_test.go
: Provides utility functions related to time, including parsing and formatting time formats, and related unit tests.
base.go
,doc.go
,types.go
,version.go
: Version management tool, used for defining and managing project version information.