func budgetCheckbudgetExceeded()

in code/function/function.go [79:92]


func budgetCheckbudgetExceeded(m PubSubMessage) (bool, error) {
	data := string(m.Data)

	notice := BillingNotice{}
	if err := json.Unmarshal([]byte(data), &notice); err != nil {
		return false, fmt.Errorf("cannot unmarshall Pub/Sub message: %s", err)
	}

	if notice.Cost <= notice.Budget {
		return false, nil
	}

	return true, nil
}