package GCP_CLOUD_FUNCTIONS

import (
	"context"

	"github.com/GoogleCloudPlatform/functions-framework-go/functions"
	"github.com/cloudevents/sdk-go/v2/event"
)

func init() {
	// 注册 Cloud Function 入口点，CloudEvent 必须代码中显式注册，否则无法触发
	// 这里和 http 触发器不一样
	functions.CloudEvent("ProcessSCCAlert", ProcessSCCAlert)
}

// ProcessSCCAlert 是主入口函数
func ProcessSCCAlert(ctx context.Context, e event.Event) error {
	return StartAlertHandler(ctx, e)
}
