Versions in this module Expand all Collapse all v0 v0.1.23 Mar 2, 2026 Changes in this version + func Initialize(spec interface{}) error + func ParseClaimsFromRequest(r *http.Request, claims interface{}) error + func ParsePubSubEnvelope(r *http.Request) ([]byte, string, time.Time, error) + func UnmarshalJSONBody(r *http.Request, target interface{}) error + func ValidateStruct(s any) []error + type Config struct + CloudSQLConnection string + CloudSQLDatabase string + CloudSQLUser string + GCPProjectID string + Host string + ServiceAccount string + type EndpointHandler func(*Service, *http.Request) *HTTPResponse + type HTTPResponse struct + Body io.ReadCloser + Headers http.Header + StatusCode int + func InternalServerError() *HTTPResponse + func JSON(statusCode int, obj interface{}) *HTTPResponse + func NotImplemented() *HTTPResponse + func Text(statusCode int, text string) *HTTPResponse + func Textf(statusCode int, text string, args ...any) *HTTPResponse + type PubSubHandler func(*Service, PubSubMessage) error + type PubSubMessage struct + Data []byte + ID string + Published time.Time + type Service struct + CloudStorageClient *storage.Client + CloudTasksClient *cloudtasks.Client + Context context.Context + DB *sql.DB + GoogleCredentials *google.Credentials + IAMClient *credentials.IamCredentialsClient + Log *slog.Logger + Name string + func New(serviceName string, config Config) (*Service, error) + func (s *Service) AddAuthenticatedEndpoint(method, relativePath, permission string, handler EndpointHandler) + func (s *Service) AddCloudSchedulerEndpoint(relativePath string, handler EndpointHandler) + func (s *Service) AddCloudTaskEndpoint(relativePath string, handler EndpointHandler) + func (s *Service) AddCloudWorkflowEndpoint(relativePath string, handler EndpointHandler) + func (s *Service) AddPubSubEndpoint(relativePath string, handler EndpointHandler) + func (s *Service) AddPublicEndpoint(method, relativePath string, handler EndpointHandler) + func (s *Service) AddServiceEndpoint(method, relativePath, permission string, handler EndpointHandler) + func (s *Service) AddWebsocketEndpoint(relativePath string, handler WebsocketHandler) + func (s *Service) AuthClient() (*http.Client, error) + func (s *Service) AuthenticateRequest(r *http.Request, permission string) (bool, error) + func (s *Service) Config() *Config + func (s *Service) CreateCloudTask(queue, name, callbackURL string, body []byte, delay, timeout time.Duration) error + func (s *Service) GenerateGoogleIDToken(audience string) (string, error) + func (s *Service) IsRequestFromService(r *http.Request) bool + func (s *Service) PublishToPubSub(topic string, message interface{}) (string, error) + func (s *Service) Run(state State) + func (s *Service) SetAuthProvider(authProvider auth.AuthProvider) error + func (s *Service) Shutdown() + type State struct + Running func() + Starting func() + Terminating func(err error) + type WebsocketHandler func(*Service, *websocket.Conn)