WSGI 서비스 라이브러리
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 모듈에는 Google 프로토콜 RPC 서비스를 WSGI 애플리케이션으로 게시하는 클래스가 포함되어 있습니다.
protorpc.wsgi.service
패키지는 다음과 같은 함수를 제공합니다.
- service_mapping(service_factory, service_path=r'.*', protocols=None)
-
단일 Google Protocol RPC 서비스 매핑을 처리하는 WSGI 애플리케이션을 만듭니다.
인수
- service_factory
- 서비스의 새 인스턴스를 만들기 위한 서비스 클래스 또는 서비스 팩토리입니다. 서비스 팩토리에 대한 자세한 내용은 remote.Service.new_factory를 참조하세요.
- service_path=r'.*'
- 서비스가 상주하는 경로입니다.
- protocols=None
- 서버에서 지원되는 프로토콜을 구성하는 remote.Protocols 인스턴스입니다.
단일 Google 프로토콜 RPC 서비스 매핑을 처리하는 WSGI 애플리케이션을 반환합니다.
- service_mappings(services, registry_path=DEFAULT_REGISTRY_PATH)
-
선택적 레지스트리 서비스와의 여러 서비스 매핑을 갖는 WSGI 애플리케이션을 만듭니다. 예를 들면 다음과 같습니다.
from protorpc import remote
from protorpc.wsgi import service
package = 'my_package'
class MyService(remote.Service):
...
class MyOtherService(remote.Service):
...
app = service.service_mappings(
[('/my_path', MyService), # Maps to /my_path
('/my_other_path', MyOtherService), # Maps to /my_other_path
])
(path, service) 튜플을 지정하여 서비스를 URL 경로에 매핑합니다. 여기에서 path는 서비스가 상주하는 경로이고, service는 서비스의 새 인스턴스를 만들기 위한 서비스 클래스 또는 서비스 팩토리입니다. 서비스 팩토리에 대한 자세한 내용은 remote.Service.new_factory를 참조하세요.
인수
- 서비스
- (path, service) 튜플의 목록입니다. 여기에서
path
는 서비스가 상주하는 경로이고, service
는 서비스의 새 인스턴스를 만들기 위한 서비스 클래스 또는 서비스 팩토리입니다. 서비스 팩토리에 대한 자세한 내용은 remote.Service.new_factory를 참조하세요.
- registry_path=DEFAULT_REGISTRY_PATH
- 레지스트리 서비스에 제공되는 경로입니다. 레지스트리 서비스를 사용 중지하려면 None을 사용합니다.
선택적 레지스트리 서비스와의 여러 서비스 매핑을 갖는 WSGI 애플리케이션을 반환합니다.
중복된 경로가 제공되면 ServiceConfigurationError
가 발생합니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-19(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-19(UTC)"],[[["\u003cp\u003eThis module provides tools to publish Google Protocol RPC services as WSGI applications.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eservice_mapping\u003c/code\u003e function creates a WSGI application for a single RPC service, using a service factory or class to instantiate the service.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eservice_mappings\u003c/code\u003e function enables the creation of a WSGI application that hosts multiple services, each mapped to a specific URL path.\u003c/p\u003e\n"],["\u003cp\u003eBoth functions allow the use of service factories for the creation of service instances.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eservice_mappings\u003c/code\u003e function can include an optional registry service and will raise a \u003ccode\u003eServiceConfigurationError\u003c/code\u003e if duplicate paths are given.\u003c/p\u003e\n"]]],[],null,[]]