dmsc 0.1.4__cp311-cp311-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dmsc/__init__.py +237 -0
- dmsc/dmsc.cp311-win_amd64.pyd +0 -0
- dmsc-0.1.4.dist-info/METADATA +324 -0
- dmsc-0.1.4.dist-info/RECORD +6 -0
- dmsc-0.1.4.dist-info/WHEEL +4 -0
- dmsc-0.1.4.dist-info/licenses/LICENSE +201 -0
dmsc/__init__.py
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
# Copyright © 2025-2026 Wenze Wei. All Rights Reserved.
|
|
4
|
+
#
|
|
5
|
+
# This file is part of DMSC.
|
|
6
|
+
# The DMSC project belongs to the Dunimd Team.
|
|
7
|
+
#
|
|
8
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
# you may not use this file except in compliance with the License.
|
|
10
|
+
# You may obtain a copy of the License at
|
|
11
|
+
#
|
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
#
|
|
14
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
# See the License for the specific language governing permissions and
|
|
18
|
+
# limitations under the License.
|
|
19
|
+
|
|
20
|
+
"""
|
|
21
|
+
DMSC (Dunimd Middleware Service) - A high-performance Rust middleware framework with modular architecture.
|
|
22
|
+
|
|
23
|
+
This Python library provides bindings to the DMSC Rust core, enabling Python applications to leverage
|
|
24
|
+
a comprehensive set of middleware services including caching, messaging, service mesh, authentication,
|
|
25
|
+
device management, observability, protocol handling, and database integration. The framework follows
|
|
26
|
+
a plugin-based architecture where each module provides specialized functionality that can be composed
|
|
27
|
+
into unified middleware solutions.
|
|
28
|
+
|
|
29
|
+
Key Components:
|
|
30
|
+
- Core Framework: Application lifecycle management, configuration, logging, and filesystem abstraction
|
|
31
|
+
- Python Module Support: Native integration for Python-based service modules
|
|
32
|
+
- Infrastructure Services: Caching, queuing, and database connectivity
|
|
33
|
+
- Traffic Management: Gateway routing, rate limiting, and circuit breaker patterns
|
|
34
|
+
- Service Mesh: Service discovery, load balancing, and traffic routing
|
|
35
|
+
- Security: Authentication, authorization, and session management
|
|
36
|
+
- Device Management: IoT device control and resource allocation
|
|
37
|
+
- Observability: Metrics collection, tracing, and health monitoring
|
|
38
|
+
- Protocol Support: Multi-protocol connection handling and frame processing
|
|
39
|
+
- Data Validation: Schema validation, sanitization, and error reporting
|
|
40
|
+
|
|
41
|
+
Example Usage:
|
|
42
|
+
from dmsc import DMSCAppBuilder, DMSCCacheModule, DMSCGateway
|
|
43
|
+
|
|
44
|
+
app = DMSCAppBuilder("my_service").build()
|
|
45
|
+
cache = DMSCCacheModule()
|
|
46
|
+
gateway = DMSCGateway()
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
__version__ = "0.1.4"
|
|
50
|
+
__author__ = "Dunimd Team"
|
|
51
|
+
__license__ = "Apache-2.0"
|
|
52
|
+
|
|
53
|
+
# Import the Rust extension module containing all DMSC bindings
|
|
54
|
+
# The dmsc extension is generated by PyO3 and provides zero-overhead access to Rust implementations
|
|
55
|
+
from .dmsc import (
|
|
56
|
+
# =============================================================================
|
|
57
|
+
# Core classes - Fundamental framework components for application lifecycle,
|
|
58
|
+
# configuration management, logging, hooks, and service context management
|
|
59
|
+
# =============================================================================
|
|
60
|
+
DMSCAppBuilder, DMSCAppRuntime, DMSCConfig, DMSCConfigManager, DMSCError,
|
|
61
|
+
DMSCFileSystem, DMSCHookBus, DMSCHookEvent, DMSCHookKind, DMSCLogConfig,
|
|
62
|
+
DMSCLogLevel, DMSCLogger, DMSCModulePhase, DMSCServiceContext,
|
|
63
|
+
|
|
64
|
+
# =============================================================================
|
|
65
|
+
# Python module support - Enables Python-based service modules to integrate
|
|
66
|
+
# with the DMSC framework, supporting both synchronous and asynchronous service patterns
|
|
67
|
+
# =============================================================================
|
|
68
|
+
DMSCPyModule, DMSCPyModuleAdapter, DMSCPyServiceModule, DMSCPyAsyncServiceModule,
|
|
69
|
+
|
|
70
|
+
# =============================================================================
|
|
71
|
+
# Cache classes - In-memory caching with configurable backends, eviction policies,
|
|
72
|
+
# statistics tracking, and event notification capabilities
|
|
73
|
+
# =============================================================================
|
|
74
|
+
DMSCCacheModule, DMSCCacheManager, DMSCCacheConfig, DMSCCacheBackendType,
|
|
75
|
+
DMSCCachePolicy, DMSCCacheStats, DMSCCachedValue, DMSCCacheEvent,
|
|
76
|
+
|
|
77
|
+
# =============================================================================
|
|
78
|
+
# Queue classes - Message queuing with multiple backend support, retry policies,
|
|
79
|
+
# dead letter handling, and queue statistics monitoring
|
|
80
|
+
# =============================================================================
|
|
81
|
+
DMSCQueueModule, DMSCQueueConfig, DMSCQueueManager, DMSCQueueMessage,
|
|
82
|
+
DMSCQueueStats, DMSCQueueBackendType, DMSCRetryPolicy, DMSCDeadLetterConfig,
|
|
83
|
+
|
|
84
|
+
# =============================================================================
|
|
85
|
+
# Gateway classes - Traffic management including HTTP routing, rate limiting,
|
|
86
|
+
# circuit breaker patterns, and sliding window algorithms for distributed systems
|
|
87
|
+
# =============================================================================
|
|
88
|
+
DMSCGateway, DMSCGatewayConfig, DMSCRouter, DMSCRoute,
|
|
89
|
+
DMSCRateLimiter, DMSCRateLimitConfig, RateLimitStats,
|
|
90
|
+
DMSCSlidingWindowRateLimiter, DMSCCircuitBreaker, DMSCCircuitBreakerConfig,
|
|
91
|
+
DMSCCircuitBreakerState, CircuitBreakerMetrics,
|
|
92
|
+
|
|
93
|
+
# =============================================================================
|
|
94
|
+
# Service mesh classes - Service discovery, traffic routing, load balancing,
|
|
95
|
+
# weighted destinations, and traffic splitting for microservices architecture
|
|
96
|
+
# =============================================================================
|
|
97
|
+
DMSCServiceMesh, DMSCServiceMeshConfig, DMSCServiceDiscovery,
|
|
98
|
+
DMSCServiceInstance, DMSCServiceStatus,
|
|
99
|
+
DMSCTrafficRoute, DMSCMatchCriteria, DMSCRouteAction, DMSCWeightedDestination,
|
|
100
|
+
|
|
101
|
+
# =============================================================================
|
|
102
|
+
# Auth classes - Authentication and authorization including JWT management,
|
|
103
|
+
# session handling, OAuth integration, role-based and permission-based access control
|
|
104
|
+
# =============================================================================
|
|
105
|
+
DMSCAuthModule, DMSCAuthConfig, DMSCJWTManager, DMSCSessionManager,
|
|
106
|
+
DMSCSecurityManager, DMSCOAuthManager, DMSCOAuthToken, DMSCOAuthUserInfo,
|
|
107
|
+
DMSCPermissionManager, DMSCPermission, DMSCRole, JWTRevocationList,
|
|
108
|
+
|
|
109
|
+
# =============================================================================
|
|
110
|
+
# Device classes - IoT device management including device control, health monitoring,
|
|
111
|
+
# resource allocation, connection pooling, and network device discovery
|
|
112
|
+
# =============================================================================
|
|
113
|
+
DMSCDeviceControlModule, DMSCDevice, DMSCDeviceType, DMSCDeviceStatus,
|
|
114
|
+
DMSCDeviceCapabilities, DMSCDeviceHealthMetrics, DMSCDeviceController,
|
|
115
|
+
DMSCDeviceConfig, DMSCDeviceControlConfig, NetworkDeviceInfo,
|
|
116
|
+
DMSCDiscoveryResult, DMSCResourceRequest,
|
|
117
|
+
DMSCResourceAllocation, DMSCRequestSlaClass, DMSCResourceWeights,
|
|
118
|
+
DMSCAffinityRules,
|
|
119
|
+
DMSCResourcePool, DMSCResourcePoolConfig, DMSCResourcePoolStatistics, DMSCResourcePoolManager,
|
|
120
|
+
DMSCConnectionPoolStatistics,
|
|
121
|
+
|
|
122
|
+
# =============================================================================
|
|
123
|
+
# Observability classes - Metrics, tracing, and health monitoring for system
|
|
124
|
+
# observability and performance analysis
|
|
125
|
+
# =============================================================================
|
|
126
|
+
DMSCObservabilityModule, DMSCObservabilityConfig,
|
|
127
|
+
DMSCMetricsRegistry, DMSCTracer,
|
|
128
|
+
DMSCMetricType, DMSCMetricConfig, DMSCMetricSample, DMSCMetric,
|
|
129
|
+
DMSCObservabilityData,
|
|
130
|
+
|
|
131
|
+
# =============================================================================
|
|
132
|
+
# Validation classes - Data validation, schema validation, sanitization,
|
|
133
|
+
# and validation result reporting with configurable severity levels
|
|
134
|
+
# =============================================================================
|
|
135
|
+
DMSCValidationError, DMSCValidationResult, DMSCValidationSeverity,
|
|
136
|
+
DMSCValidatorBuilder, DMSCValidationRunner, DMSCSanitizer,
|
|
137
|
+
DMSCSanitizationConfig, DMSCSchemaValidator, DMSCValidationModule,
|
|
138
|
+
|
|
139
|
+
# =============================================================================
|
|
140
|
+
# Protocol classes - Multi-protocol support including connection management,
|
|
141
|
+
# frame processing, security levels, and protocol statistics monitoring
|
|
142
|
+
# =============================================================================
|
|
143
|
+
DMSCProtocolManager, DMSCProtocolType, DMSCProtocolConfig,
|
|
144
|
+
DMSCProtocolStatus, DMSCProtocolStats, DMSCConnectionState,
|
|
145
|
+
DMSCConnectionStats, DMSCProtocolHealth,
|
|
146
|
+
DMSCFrame, DMSCFrameHeader, DMSCFrameType,
|
|
147
|
+
DMSCConnectionInfo, DMSCMessageFlags, DMSCSecurityLevel,
|
|
148
|
+
|
|
149
|
+
# =============================================================================
|
|
150
|
+
# Database classes - Database configuration, connection pooling, row-level
|
|
151
|
+
# access, and result set management across different database backends
|
|
152
|
+
# =============================================================================
|
|
153
|
+
DMSCDatabaseConfig, DMSCDatabasePool, DMSCDBRow, DMSCDBResult, DatabaseType,
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
# =============================================================================
|
|
157
|
+
# Submodules - Functional submodules organized by domain area, providing
|
|
158
|
+
# specialized functionality for specific middleware concerns
|
|
159
|
+
# =============================================================================
|
|
160
|
+
from .dmsc import (
|
|
161
|
+
log, config, device, cache, fs, hooks, observability,
|
|
162
|
+
queue, gateway, service_mesh, auth, protocol, database
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
# =============================================================================
|
|
166
|
+
# __all__ export list - Public API surface defining all symbols intended for
|
|
167
|
+
# external use. These symbols are imported when 'from dmsc import *' is used.
|
|
168
|
+
# Organized by functional category for clarity and maintainability.
|
|
169
|
+
# =============================================================================
|
|
170
|
+
__all__ = [
|
|
171
|
+
# Core classes - Application framework, configuration, logging, and hooks
|
|
172
|
+
'DMSCAppBuilder', 'DMSCAppRuntime', 'DMSCConfig', 'DMSCConfigManager', 'DMSCError',
|
|
173
|
+
'DMSCFileSystem', 'DMSCHookBus', 'DMSCHookEvent', 'DMSCHookKind', 'DMSCLogConfig',
|
|
174
|
+
'DMSCLogLevel', 'DMSCLogger', 'DMSCModulePhase', 'DMSCServiceContext',
|
|
175
|
+
|
|
176
|
+
# Python module support - Python service module integration
|
|
177
|
+
'DMSCPyModule', 'DMSCPyModuleAdapter', 'DMSCPyServiceModule', 'DMSCPyAsyncServiceModule',
|
|
178
|
+
|
|
179
|
+
# Cache classes - Caching infrastructure and management
|
|
180
|
+
'DMSCCacheModule', 'DMSCCacheManager', 'DMSCCacheConfig', 'DMSCCacheBackendType',
|
|
181
|
+
'DMSCCachePolicy', 'DMSCCacheStats', 'DMSCCachedValue', 'DMSCCacheEvent',
|
|
182
|
+
|
|
183
|
+
# Queue classes - Message queuing infrastructure
|
|
184
|
+
'DMSCQueueModule', 'DMSCQueueConfig', 'DMSCQueueManager', 'DMSCQueueMessage',
|
|
185
|
+
'DMSCQueueStats', 'DMSCQueueBackendType', 'DMSCRetryPolicy', 'DMSCDeadLetterConfig',
|
|
186
|
+
|
|
187
|
+
# Gateway classes - Traffic management and resilience patterns
|
|
188
|
+
'DMSCGateway', 'DMSCGatewayConfig', 'DMSCRouter', 'DMSCRoute',
|
|
189
|
+
'DMSCRateLimiter', 'DMSCRateLimitConfig', 'RateLimitStats',
|
|
190
|
+
'DMSCSlidingWindowRateLimiter', 'DMSCCircuitBreaker', 'DMSCCircuitBreakerConfig',
|
|
191
|
+
'DMSCCircuitBreakerState', 'CircuitBreakerMetrics',
|
|
192
|
+
|
|
193
|
+
# Service mesh classes - Service discovery and traffic routing
|
|
194
|
+
'DMSCServiceMesh', 'DMSCServiceMeshConfig', 'DMSCServiceDiscovery',
|
|
195
|
+
'DMSCServiceInstance', 'DMSCServiceStatus',
|
|
196
|
+
'DMSCTrafficRoute', 'DMSCMatchCriteria', 'DMSCRouteAction', 'DMSCWeightedDestination',
|
|
197
|
+
|
|
198
|
+
# Auth classes - Authentication, authorization, and session management
|
|
199
|
+
'DMSCAuthModule', 'DMSCAuthConfig', 'DMSCJWTManager', 'DMSCSessionManager',
|
|
200
|
+
'DMSCSecurityManager', 'DMSCOAuthManager', 'DMSCOAuthToken', 'DMSCOAuthUserInfo',
|
|
201
|
+
'DMSCPermissionManager', 'DMSCPermission', 'DMSCRole', 'JWTRevocationList',
|
|
202
|
+
|
|
203
|
+
# Device classes - IoT device control and resource management
|
|
204
|
+
'DMSCDeviceControlModule', 'DMSCDevice', 'DMSCDeviceType', 'DMSCDeviceStatus',
|
|
205
|
+
'DMSCDeviceCapabilities', 'DMSCDeviceHealthMetrics', 'DMSCDeviceController',
|
|
206
|
+
'DMSCDeviceConfig', 'DMSCDeviceControlConfig', 'NetworkDeviceInfo',
|
|
207
|
+
'DMSCDiscoveryResult', 'DMSCResourceRequest',
|
|
208
|
+
'DMSCResourceAllocation', 'DMSCRequestSlaClass', 'DMSCResourceWeights',
|
|
209
|
+
'DMSCAffinityRules',
|
|
210
|
+
'DMSCResourcePool', 'DMSCResourcePoolConfig', 'DMSCResourcePoolStatistics', 'DMSCResourcePoolManager',
|
|
211
|
+
'DMSCConnectionPoolStatistics',
|
|
212
|
+
|
|
213
|
+
# Observability classes - Metrics, tracing, and health monitoring
|
|
214
|
+
'DMSCObservabilityModule', 'DMSCObservabilityConfig',
|
|
215
|
+
'DMSCMetricsRegistry', 'DMSCTracer',
|
|
216
|
+
'DMSCMetricType', 'DMSCMetricConfig', 'DMSCMetricSample', 'DMSCMetric',
|
|
217
|
+
'DMSCObservabilityData',
|
|
218
|
+
|
|
219
|
+
# Validation classes - Data validation and sanitization
|
|
220
|
+
'DMSCValidationError', 'DMSCValidationResult', 'DMSCValidationSeverity',
|
|
221
|
+
'DMSCValidatorBuilder', 'DMSCValidationRunner', 'DMSCSanitizer',
|
|
222
|
+
'DMSCSanitizationConfig', 'DMSCSchemaValidator', 'DMSCValidationModule',
|
|
223
|
+
|
|
224
|
+
# Protocol classes - Protocol management and connection handling
|
|
225
|
+
'DMSCProtocolManager', 'DMSCProtocolType', 'DMSCProtocolConfig',
|
|
226
|
+
'DMSCProtocolStatus', 'DMSCProtocolStats', 'DMSCConnectionState',
|
|
227
|
+
'DMSCConnectionStats', 'DMSCProtocolHealth',
|
|
228
|
+
'DMSCFrame', 'DMSCFrameHeader', 'DMSCFrameType',
|
|
229
|
+
'DMSCConnectionInfo', 'DMSCMessageFlags', 'DMSCSecurityLevel',
|
|
230
|
+
|
|
231
|
+
# Database classes - Database configuration and connection pooling
|
|
232
|
+
'DMSCDatabaseConfig', 'DMSCDatabasePool', 'DMSCDBRow', 'DMSCDBResult', 'DatabaseType',
|
|
233
|
+
|
|
234
|
+
# Submodules - Functional submodule references
|
|
235
|
+
'log', 'config', 'device', 'cache', 'fs', 'hooks', 'observability',
|
|
236
|
+
'queue', 'gateway', 'service_mesh', 'auth', 'protocol', 'database'
|
|
237
|
+
]
|
|
Binary file
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dmsc
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Classifier: Programming Language :: Rust
|
|
5
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Summary: Dunimd Middleware Service - A high-performance Rust middleware framework with modular architecture
|
|
16
|
+
Keywords: middleware,rust,async,gateway,service-mesh
|
|
17
|
+
Author: Dunimd Team
|
|
18
|
+
Requires-Python: >=3.8
|
|
19
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
20
|
+
|
|
21
|
+
<div align="center">
|
|
22
|
+
|
|
23
|
+
# DMSCC (Dunimd Middleware Service)
|
|
24
|
+
|
|
25
|
+
English | [简体中文](README.zh.md)
|
|
26
|
+
|
|
27
|
+
[Help Documentation](doc/en/index.md)
|
|
28
|
+
|
|
29
|
+
<a href="https://space.bilibili.com/3493284091529457" target="_blank">
|
|
30
|
+
<img alt="BiliBili" src="https://img.shields.io/badge/BiliBili-Dunimd-00A1D6?style=flat-square&logo=bilibili"/>
|
|
31
|
+
</a>
|
|
32
|
+
<a href="https://gitee.com/dunimd" target="_blank">
|
|
33
|
+
<img alt="Gitee" src="https://img.shields.io/badge/Gitee-Dunimd-C71D23?style=flat-square&logo=gitee"/>
|
|
34
|
+
</a>
|
|
35
|
+
<a href="https://github.com/mf2023/DMSC" target="_blank">
|
|
36
|
+
<img alt="GitHub" src="https://img.shields.io/badge/GitHub-DMSC-181717?style=flat-square&logo=github"/>
|
|
37
|
+
</a>
|
|
38
|
+
<a href="https://crates.io/crates/dmsc" target="_blank">
|
|
39
|
+
<img alt="Crates.io" src="https://img.shields.io/badge/Crates-DMSC-000000?style=flat-square&logo=rust"/>
|
|
40
|
+
</a>
|
|
41
|
+
<a href="https://pypi.org/project/dmsc/" target="_blank">
|
|
42
|
+
<img alt="PyPI" src="https://img.shields.io/badge/PyPI-DMSC-3775A9?style=flat-square&logo=pypi"/>
|
|
43
|
+
</a>
|
|
44
|
+
|
|
45
|
+
**DMSC (Dunimd Middleware Service)** — A high-performance Rust middleware framework that unifies backend infrastructure. Built for enterprise-scale with modular architecture, built-in observability, and distributed systems support.
|
|
46
|
+
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<h2 align="center">🏗️ Core Architecture</h2>
|
|
50
|
+
|
|
51
|
+
### 📐 Modular Design
|
|
52
|
+
DMSC adopts a highly modular architecture with 17 core modules, enabling on-demand composition and seamless extension:
|
|
53
|
+
|
|
54
|
+
<div align="center">
|
|
55
|
+
|
|
56
|
+
| Module | Description |
|
|
57
|
+
|:--------|:-------------|
|
|
58
|
+
| **auth** | Authentication & authorization (JWT, OAuth, permissions) |
|
|
59
|
+
| **cache** | Multi-backend cache abstraction (Memory, Redis, Hybrid) |
|
|
60
|
+
| **config** | Multi-source configuration management with hot reload |
|
|
61
|
+
| **core** | Runtime, error handling, and service context |
|
|
62
|
+
| **database** | Database abstraction with PostgreSQL, MySQL, SQLite support |
|
|
63
|
+
| **device** | Device control, discovery, and intelligent scheduling |
|
|
64
|
+
| **fs** | Secure file system operations and management |
|
|
65
|
+
| **gateway** | API gateway with load balancing, rate limiting, and circuit breaking |
|
|
66
|
+
| **grpc** | gRPC server and client support with Python bindings |
|
|
67
|
+
| **hooks** | Lifecycle event hooks (Startup, Shutdown, etc.) |
|
|
68
|
+
| **log** | Structured logging with tracing context integration |
|
|
69
|
+
| **observability** | Metrics, tracing, and Grafana integration |
|
|
70
|
+
| **orm** | Type-safe ORM with repository pattern, query builder, and Python bindings |
|
|
71
|
+
| **queue** | Distributed queue abstraction (Kafka, RabbitMQ, Redis, Memory) |
|
|
72
|
+
| **service_mesh** | Service discovery, health checking, and traffic management |
|
|
73
|
+
| **validation** | Input validation and data sanitization utilities |
|
|
74
|
+
| **ws** | WebSocket server support with Python bindings |
|
|
75
|
+
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
### 🚀 Key Features
|
|
79
|
+
|
|
80
|
+
#### 🔍 Distributed Tracing
|
|
81
|
+
- W3C Trace Context standard implementation
|
|
82
|
+
- Full-chain TraceID/SpanID propagation
|
|
83
|
+
- Baggage data transmission for business context
|
|
84
|
+
- Multi-language compatibility (Java, Go, Python)
|
|
85
|
+
|
|
86
|
+
#### 📊 Enterprise Observability
|
|
87
|
+
- Native Prometheus metrics export
|
|
88
|
+
- Counter, Gauge, Histogram, Summary metric types
|
|
89
|
+
- Out-of-the-box Grafana dashboard integration
|
|
90
|
+
- Real-time performance statistics with quantile calculation
|
|
91
|
+
- Full-stack metrics (CPU, memory, I/O, network)
|
|
92
|
+
|
|
93
|
+
#### 🤖 Intelligent Device Management
|
|
94
|
+
- Auto-discovery and registration
|
|
95
|
+
- Efficient resource pool management
|
|
96
|
+
- Policy-based scheduling with priority support
|
|
97
|
+
- Dynamic load balancing
|
|
98
|
+
- Complete device lifecycle management
|
|
99
|
+
|
|
100
|
+
#### 📝 Structured Logging
|
|
101
|
+
- JSON and text format support
|
|
102
|
+
- Configurable sampling rates
|
|
103
|
+
- Intelligent log rotation
|
|
104
|
+
- Automatic tracing context inclusion
|
|
105
|
+
- DEBUG/INFO/WARN/ERROR log levels
|
|
106
|
+
|
|
107
|
+
#### ⚙️ Flexible Configuration
|
|
108
|
+
- Multi-source loading (files, environment variables, runtime)
|
|
109
|
+
- Hot configuration updates
|
|
110
|
+
- Modular architecture for on-demand composition
|
|
111
|
+
- Plugin-based extension mechanism
|
|
112
|
+
|
|
113
|
+
#### 📁 Secure File System
|
|
114
|
+
- Unified project root directory management
|
|
115
|
+
- Atomic file operations
|
|
116
|
+
- Categorized directory structure
|
|
117
|
+
- JSON data persistence
|
|
118
|
+
- Secure path handling
|
|
119
|
+
|
|
120
|
+
<h2 align="center">🛠️ Installation & Environment</h2>
|
|
121
|
+
|
|
122
|
+
### Prerequisites
|
|
123
|
+
- **Rust**: 1.65+ (2021 Edition)
|
|
124
|
+
- **Cargo**: 1.65+
|
|
125
|
+
- **Platforms**: Linux, macOS, Windows
|
|
126
|
+
|
|
127
|
+
### Quick Setup
|
|
128
|
+
|
|
129
|
+
Add DMSC to your project's `Cargo.toml`:
|
|
130
|
+
|
|
131
|
+
```toml
|
|
132
|
+
[dependencies]
|
|
133
|
+
dmsc = { git = "https://github.com/mf2023/DMSC" }
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Or use cargo add:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
cargo add DMSC --git https://github.com/mf2023/DMSC
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
<h2 align="center">⚡ Quick Start</h2>
|
|
143
|
+
|
|
144
|
+
### Core API Usage
|
|
145
|
+
|
|
146
|
+
```rust
|
|
147
|
+
use dmsc::prelude::*;
|
|
148
|
+
|
|
149
|
+
#[tokio::main]
|
|
150
|
+
async fn main() -> DMSCResult<()> {
|
|
151
|
+
// Build service runtime
|
|
152
|
+
let app = DMSCAppBuilder::new()
|
|
153
|
+
.with_config("config.yaml")?
|
|
154
|
+
.with_logging(DMSCLogConfig::default())?
|
|
155
|
+
.with_observability(DMSCObservabilityConfig::default())?
|
|
156
|
+
.build()?;
|
|
157
|
+
|
|
158
|
+
// Run business logic
|
|
159
|
+
app.run(|ctx: &DMSCServiceContext| async move {
|
|
160
|
+
ctx.logger().info("service", "DMSC service started")?;
|
|
161
|
+
// Your business code here
|
|
162
|
+
Ok(())
|
|
163
|
+
}).await
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Observability Example
|
|
168
|
+
|
|
169
|
+
```rust
|
|
170
|
+
use dmsc::observability::*;
|
|
171
|
+
|
|
172
|
+
#[tracing::instrument(name = "user_service", skip(ctx))]
|
|
173
|
+
async fn get_user(ctx: &DMSCServiceContext, user_id: u64) -> DMSCResult<User> {
|
|
174
|
+
let user = fetch_user_from_db(user_id).await?;
|
|
175
|
+
Ok(user)
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
或者使用手动 span:
|
|
180
|
+
|
|
181
|
+
```rust
|
|
182
|
+
use dmsc::prelude::*;
|
|
183
|
+
|
|
184
|
+
async fn get_user(ctx: &DMSCServiceContext, user_id: u64) -> DMSCResult<User> {
|
|
185
|
+
let _span = ctx.tracer().start_span("get_user")?;
|
|
186
|
+
let user = fetch_user_from_db(user_id).await?;
|
|
187
|
+
Ok(user)
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
<h2 align="center">🔧 Configuration</h2>
|
|
192
|
+
|
|
193
|
+
### Configuration Example
|
|
194
|
+
|
|
195
|
+
```yaml
|
|
196
|
+
# config.yaml
|
|
197
|
+
service:
|
|
198
|
+
name: "my-service"
|
|
199
|
+
version: "1.0.0"
|
|
200
|
+
|
|
201
|
+
logging:
|
|
202
|
+
level: "info"
|
|
203
|
+
file_format: "json"
|
|
204
|
+
file_enabled: true
|
|
205
|
+
console_enabled: true
|
|
206
|
+
|
|
207
|
+
observability:
|
|
208
|
+
metrics_enabled: true
|
|
209
|
+
tracing_enabled: true
|
|
210
|
+
prometheus_port: 9090
|
|
211
|
+
|
|
212
|
+
resource:
|
|
213
|
+
providers: ["cpu", "gpu", "memory"]
|
|
214
|
+
scheduling_policy: "priority_based"
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Configuration Sources
|
|
218
|
+
|
|
219
|
+
DMSC supports multiple configuration sources in order of priority (lowest to highest):
|
|
220
|
+
1. Configuration files (YAML, TOML, JSON)
|
|
221
|
+
2. Custom configuration via code
|
|
222
|
+
3. Environment variables (prefixed with `DMSC_`)
|
|
223
|
+
|
|
224
|
+
<h2 align="center">🧪 Development & Testing</h2>
|
|
225
|
+
|
|
226
|
+
### Running Tests
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
# Run all tests
|
|
230
|
+
cargo test
|
|
231
|
+
|
|
232
|
+
# Run specific test module
|
|
233
|
+
cargo test cache
|
|
234
|
+
|
|
235
|
+
# Run with verbose output
|
|
236
|
+
cargo test -- --nocapture
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
<h2 align="center">❓ Frequently Asked Questions</h2>
|
|
240
|
+
|
|
241
|
+
**Q: How to add a new module?**
|
|
242
|
+
A: Implement the `DMSCModule` trait and register it via `DMSCAppBuilder::with_module`.
|
|
243
|
+
|
|
244
|
+
**Q: How to configure logging level?**
|
|
245
|
+
A: Set `logging.level` in the configuration file, supporting DEBUG/INFO/WARN/ERROR levels.
|
|
246
|
+
|
|
247
|
+
**Q: How to enable metrics export?**
|
|
248
|
+
A: Set `observability.metrics_enabled: true` and configure `prometheus_port` in the configuration file.
|
|
249
|
+
|
|
250
|
+
**Q: How to extend configuration sources?**
|
|
251
|
+
A: Implement a custom configuration loader and register it with `DMSCConfigManager`.
|
|
252
|
+
|
|
253
|
+
**Q: How to handle asynchronous tasks?**
|
|
254
|
+
A: Use `DMSCAppBuilder::with_async_module` to add async modules, the framework handles async lifecycle automatically.
|
|
255
|
+
|
|
256
|
+
<h2 align="center">🌏 Community & Citation</h2>
|
|
257
|
+
|
|
258
|
+
- Welcome to submit Issues and PRs!
|
|
259
|
+
- Gitee: https://github.com/mf2023/DMSC.git
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
<div align="center">
|
|
263
|
+
|
|
264
|
+
## 📄 License & Open Source Agreements
|
|
265
|
+
|
|
266
|
+
### 🏛️ Project License
|
|
267
|
+
|
|
268
|
+
<p align="center">
|
|
269
|
+
<a href="LICENSE">
|
|
270
|
+
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="Apache License 2.0">
|
|
271
|
+
</a>
|
|
272
|
+
</p>
|
|
273
|
+
|
|
274
|
+
This project uses **Apache License 2.0** open source agreement, see [LICENSE](LICENSE) file.
|
|
275
|
+
|
|
276
|
+
### 📋 Dependency Package Open Source Agreements
|
|
277
|
+
|
|
278
|
+
Open source packages and their agreement information used by this project:
|
|
279
|
+
|
|
280
|
+
### Dependencies License
|
|
281
|
+
|
|
282
|
+
<div align="center">
|
|
283
|
+
|
|
284
|
+
| 📦 Package | 📜 License |
|
|
285
|
+
|:-----------|:-----------|
|
|
286
|
+
| serde | Apache 2.0 |
|
|
287
|
+
| serde_json | MIT |
|
|
288
|
+
| serde_yaml | MIT |
|
|
289
|
+
| tokio | MIT |
|
|
290
|
+
| prometheus | Apache 2.0 |
|
|
291
|
+
| redis | MIT |
|
|
292
|
+
| hyper | MIT |
|
|
293
|
+
| lapin | Apache 2.0 |
|
|
294
|
+
| futures | MIT |
|
|
295
|
+
| yaml-rust | MIT |
|
|
296
|
+
| toml | MIT |
|
|
297
|
+
| etcd-client | MIT |
|
|
298
|
+
| sysinfo | MIT |
|
|
299
|
+
| async-trait | MIT |
|
|
300
|
+
| dashmap | MIT |
|
|
301
|
+
| chrono | MIT |
|
|
302
|
+
| uuid | Apache 2.0 |
|
|
303
|
+
| rand | MIT |
|
|
304
|
+
| notify | MIT |
|
|
305
|
+
| jsonwebtoken | MIT |
|
|
306
|
+
| reqwest | MIT |
|
|
307
|
+
| urlencoding | MIT |
|
|
308
|
+
| parking_lot | MIT |
|
|
309
|
+
| log | MIT |
|
|
310
|
+
| pyo3 | Apache 2.0 |
|
|
311
|
+
| tempfile | MIT |
|
|
312
|
+
| tracing | MIT |
|
|
313
|
+
| thiserror | MIT |
|
|
314
|
+
| hex | MIT |
|
|
315
|
+
| base64 | MIT |
|
|
316
|
+
| regex | MIT |
|
|
317
|
+
| url | Apache 2.0 |
|
|
318
|
+
| aes-gcm | Apache 2.0 |
|
|
319
|
+
| ring | Apache 2.0 |
|
|
320
|
+
| lazy_static | MIT |
|
|
321
|
+
|
|
322
|
+
</div>
|
|
323
|
+
|
|
324
|
+
</div>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
dmsc\__init__.py,sha256=sEtbSqofADU1pJhHCtW4xzHVut6AoL86Tz_lLwbHeWE,13847
|
|
2
|
+
dmsc\dmsc.cp311-win_amd64.pyd,sha256=iNJJT8WcVl-USaMndfxerG-lLfHouAJh-O0W3LXQP3E,12007936
|
|
3
|
+
dmsc-0.1.4.dist-info\METADATA,sha256=CjnooGxFJJNUhB7O21dQdnIzZRmW6nXJoav8lW_JffA,9769
|
|
4
|
+
dmsc-0.1.4.dist-info\WHEEL,sha256=X79LywvMB9iCuFHu88xBAFTJDhRqJi6Yh9hhoCI9jao,97
|
|
5
|
+
dmsc-0.1.4.dist-info\licenses\LICENSE,sha256=WtjCEwlcVzkh1ziO35P2qfVEkLjr87Flro7xlHz3CEY,11556
|
|
6
|
+
dmsc-0.1.4.dist-info\RECORD,,
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|