func Labels(labels map[string]string) Option {
	return func(h *Hook) error {
		h.labels = labels
		return nil
	}
}
Labels is an option that sets the labels to send with each log entry.
package sdhook
import (
	"errors"
	"fmt"
	"io/ioutil"
	"net/http"
	"cloud.google.com/go/compute/metadata"
	"github.com/fluent/fluent-logger-golang/fluent"
	"github.com/kenshaw/jwt/gserviceaccount"
	"github.com/sirupsen/logrus"
	"golang.org/x/oauth2"
	"golang.org/x/oauth2/google"
	errorReporting "google.golang.org/api/clouderrorreporting/v1beta1"
	logging "google.golang.org/api/logging/v2"
)
type Option func(*Hook) error
func Levels(levels ...logrus.Level) Option {
	return func(h *Hook) error {
		h.levels = levels
		return nil
	}
}
func ProjectID(projectID string) Option {
	return func(h *Hook) error {
		h.projectID = projectID
		return nil
	}
}
func EntriesService(service *logging.EntriesService) Option {
	return func(h *Hook) error {
		h.service = service
		return nil
	}
}
func LoggingService(service *logging.Service) Option {
	return func(h *Hook) error {
		h.service = service.Entries
		return nil
	}
}
func ErrorService(errorService *errorReporting.Service) Option {
	return func(h *Hook) error {
		h.errorService = errorService
		return nil
	}
}
func HTTPClient(client *http.Client) Option {
	return func(h *Hook) error {
		l, err := logging.New(client)
		if err != nil {
			return err
		}
		e, err := errorReporting.New(client)
		if err != nil {
			return err
		}
		if err = ErrorService(e)(h); err != nil {
			return err
		}
		return LoggingService(l)(h)
	}
}
func MonitoredResource(resource *logging.MonitoredResource) Option {
	return func(h *Hook) error {
		h.resource = resource
		return nil
	}
}
func Resource(typ ResType, labels map[string]string) Option {
	return func(h *Hook) error {
		return MonitoredResource(&logging.MonitoredResource{
			Type:   string(typ),
			Labels: labels,
		})(h)
	}
}
func LogName(name string) Option {
	return func(h *Hook) error {
		if h.projectID == "" {
			h.logName = name
		} else {
			h.logName = fmt.Sprintf("projects/%s/logs/%s", h.projectID, name)
		}
		return nil
	}
}
func ErrorReportingLogName(name string) Option {
	return func(h *Hook) error {
		h.errorReportingLogName = name
		return nil
	}
}