Documentation
¶
Overview ¶
Package googlechat is the gateway's Google Chat adapter. A Chat app is configured in the Google Cloud console with an HTTP endpoint URL; inbound events arrive as POSTs carrying a Google-signed bearer JWT (issuer chat@system.gserviceaccount.com) whose audience is the app's project number, and outbound replies go to the Chat REST API (spaces.messages.create) authenticated as a service account. Credentials: GOOGLE_CHAT_SA_KEY holds the path to the service-account JSON key and googlechat.audience (the project number) lives in gateway.yaml; the caller reads the key file and hands the bytes to New — this package never reads the environment.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel struct {
// contains filtered or unexported fields
}
Channel is a Google Chat app connection: webhook in, REST out.
func New ¶
New builds a Google Chat channel from the service-account key JSON, the expected JWT audience (the app's project number), and the gateway media spool directory ("" disables attachment downloads).
func (*Channel) Handler ¶
Handler returns the webhook HTTP handler. Chat expects a synchronous JSON response; we always reply asynchronously through the REST API, so a handled event returns 200 with body {} (an empty object means "no synchronous message"). A Deliver failure returns 503 so Google redelivers.