argoproj/calendar-gatewaycalendar gateway镜像是一个轻量级日历网关服务,旨在整合各类第三方日历数据源(如Google Calendar、Microsoft Outlook Calendar、Apple Calendar等),提供统一的API接口,简化应用程序对接多个日历服务的开发复杂度,实现日历数据的集中获取、转发与同步管理。
通过以下命令快速启动日历网关服务(默认配置下仅启动基础服务,需进一步配置日历源):
bashdocker run -d -p 8080:8080 --name calendar-gateway calendar-gateway:latest
通过环境变量配置网关基础参数,常用环境变量说明如下:
| 环境变量名 | 描述 | 默认值 |
|---|---|---|
PORT | 服务监听端口 | 8080 |
SUPPORTED_CALENDARS | 启用的日历源列表(逗号分隔,如google,outlook,icloud) | google |
LOG_LEVEL | 日志级别(支持debug/info/warn/error) | info |
TIMEOUT | 日历源请求超时时间(单位:秒) | 30 |
需为启用的日历源配置认证信息,支持环境变量或配置文件两种方式:
bashdocker run -d -p 8080:8080 \ -e PORT=8080 \ -e SUPPORTED_CALENDARS=google,outlook \ -e GOOGLE_CLIENT_ID="your_google_client_id" \ -e GOOGLE_CLIENT_SECRET="your_google_client_secret" \ -e OUTLOOK_CLIENT_ID="your_outlook_client_id" \ -e OUTLOOK_CLIENT_SECRET="your_outlook_client_secret" \ --name calendar-gateway calendar-gateway:latest
创建config.yaml配置文件,定义日历源及服务参数:
yamlcalendars: google: client_id: "your_google_client_id" # Google Calendar API客户端ID client_secret: "your_google_client_secret" # Google Calendar API客户端密钥 scope: "[***]" # 权限范围 outlook: client_id: "your_outlook_client_id" # Outlook Calendar API客户端ID client_secret: "your_outlook_client_secret" # Outlook Calendar API客户端密钥 tenant: "common" # 租户ID(Outlook专用,默认common) server: port: 8080 # 服务监听端口 timeout: 30 # 请求超时时间(秒) log: level: "info" # 日志级别
通过挂载配置文件启动服务:
bashdocker run -d -p 8080:8080 \ -v $(pwd)/config.yaml:/app/config/config.yaml \ --name calendar-gateway calendar-gateway:latest
通过统一API接口与网关交互,以下为获取日历事件的示例请求:
bashcurl "http://localhost:8080/api/v1/calendars/google/events?start_date=2024-01-01&end_date=2024-01-31"
google:目标日历源名称(需与配置中的日历源名称一致)start_date/end_date:事件查询的日期范围(格式:YYYY-MM-DD)响应示例(统一JSON格式):
json{ "events": [ { "id": "event_123", "title": "团队周会", "start_time": "2024-01-05T09:00:00Z", "end_time": "2024-01-05T10:00:00Z", "location": "会议室A", "description": "本周项目进度同步" } ], "source": "google", "total": 1 }

manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务