appengine

package
v0.46.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const MaxActionFilterLength = 256

MaxActionFilterLength is the longest filter expression the endpoint accepts.

View Source
const MaxActionQueryLength = 256

MaxActionQueryLength is the longest search string the endpoint accepts.

Variables

This section is empty.

Functions

func FormatActionID

func FormatActionID(appID, actionName string) string

FormatActionID is the inverse of ParseActionID, in the canonical colon form.

func ParseActionID

func ParseActionID(id string) (appID, actionName string, err error)

ParseActionID splits an action id of the form "app-id:action-name", the form workflow definitions use. "app-id/action-name", the form function ids use, is accepted too but never advertised: error messages and FormatActionID always spell the colon. It splits at the first colon or slash, whichever comes first: an app id can contain neither, an action name can contain both.

Types

type App

type App struct {
	ID               string                 `json:"id"`
	Name             string                 `json:"name"`
	Version          string                 `json:"version"`
	Description      string                 `json:"description"`
	IsBuiltin        bool                   `json:"isBuiltin,omitempty"`
	ResourceStatus   *ResourceStatus        `json:"resourceStatus,omitempty"`
	SignatureInfo    *SignatureInfo         `json:"signatureInfo,omitempty"`
	Manifest         map[string]interface{} `json:"manifest,omitempty"`
	ModificationInfo *ModificationInfo      `json:"modificationInfo,omitempty"`
}

App represents an installed app

type AppAction

type AppAction struct {
	AppID       string `json:"appId"`
	ActionName  string `json:"actionName"`
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
	Stateful    bool   `json:"stateful,omitempty"`
	Approval    bool   `json:"approval,omitempty"`
	FullName    string `json:"fullName"`

	// Extra holds the action's manifest attributes with no field above, such
	// as docs. Populated by GetAction only: GET /actions serves a fixed field
	// set, so ListActions never has them.
	Extra map[string]interface{} `json:"extra,omitempty"`
}

AppAction is one action of an installed app, as the App Registry's /actions API serves it.

type AppFunction

type AppFunction struct {
	AppID        string `json:"appId"`
	AppName      string `json:"appName"`
	FunctionName string `json:"functionName"`
	Title        string `json:"title,omitempty"`
	Description  string `json:"description,omitempty"`
	Resumable    bool   `json:"resumable"`
	Stateful     bool   `json:"stateful,omitempty"`
	FullName     string `json:"fullName"`
}

AppFunction represents a function within an app

type AppList

type AppList struct {
	Apps []App `json:"apps"`
}

AppList represents a list of apps

type DeferredExecutionRequest

type DeferredExecutionRequest struct {
	AppID        string `json:"appId"`
	FunctionName string `json:"functionName"`
	Body         string `json:"body,omitempty"`
}

DeferredExecutionRequest represents a deferred execution request

type DeferredExecutionResponse

type DeferredExecutionResponse struct {
	ID string `json:"id"`
}

DeferredExecutionResponse represents a deferred execution response

type ExecutionError

type ExecutionError struct {
	// StatusCode is the non-standard status App Engine used to report the failure.
	StatusCode int
	// Message is the platform's description of the failure.
	Message string
	// Body is the raw response body, which holds the stack trace when there is one.
	Body string
}

ExecutionError reports a failure inside the submitted function code.

It is deliberately not an httpclient.APIError. The request reached App Engine and App Engine answered; what failed is the caller's own code. Carrying it as a 5xx would classify a deterministic bug as a Dynatrace-side outage, which tells an agent to retry something that can never succeed unchanged.

func (*ExecutionError) Error

func (e *ExecutionError) Error() string

type FunctionExecutorRequest

type FunctionExecutorRequest struct {
	SourceCode string `json:"sourceCode"`
	Payload    string `json:"payload,omitempty"`
	// SDKMajorVersions pins SDK packages (package name → major version) for the
	// execution. omitzero, not omitempty: a nil map leaves the field out of the
	// request, while a non-nil empty map is still sent as {}.
	SDKMajorVersions map[string]string `json:"sdkMajorVersions,omitzero"`
}

FunctionExecutorRequest represents an ad-hoc function execution request

type FunctionExecutorResponse

type FunctionExecutorResponse struct {
	Result interface{} `json:"result"`
	Logs   string      `json:"logs"`
}

FunctionExecutorResponse represents an ad-hoc function execution response

type FunctionHandler

type FunctionHandler struct {
	// contains filtered or unexported fields
}

FunctionHandler handles App Engine function operations

func NewFunctionHandler

func NewFunctionHandler(c *httpclient.Client) *FunctionHandler

NewFunctionHandler creates a new function handler

func (*FunctionHandler) DeferExecution

DeferExecution defers execution of a resumable function

func (*FunctionHandler) ExecuteCode

func (h *FunctionHandler) ExecuteCode(ctx context.Context, sourceCode, payload string) (*FunctionExecutorResponse, error)

ExecuteCode executes ad-hoc JavaScript code using the function executor

func (*FunctionHandler) ExecuteRequest

ExecuteRequest executes a prepared ad-hoc function executor request, for callers that set fields beyond the source code and payload.

func (*FunctionHandler) GetSDKVersions

func (h *FunctionHandler) GetSDKVersions(ctx context.Context) (*SDKVersionsResponse, error)

GetSDKVersions lists available SDK versions

func (*FunctionHandler) InvokeFunction

InvokeFunction invokes an app function

type FunctionInvokeRequest

type FunctionInvokeRequest struct {
	Method       string            // HTTP method (GET, POST, PUT, PATCH, DELETE)
	AppID        string            // App ID
	FunctionName string            // Function name
	Payload      string            // Request body/payload
	Headers      map[string]string // Additional headers
}

FunctionInvokeRequest represents a function invocation request

type FunctionInvokeResponse

type FunctionInvokeResponse struct {
	StatusCode int               `json:"statusCode"`
	Headers    map[string]string `json:"headers,omitempty"`
	Body       string            `json:"body"`
	RawBody    interface{}       `json:"-"` // For direct JSON output
}

FunctionInvokeResponse represents a function invocation response

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler handles App Engine resources

func NewHandler

func NewHandler(c *httpclient.Client) *Handler

NewHandler creates a new App Engine handler

func (*Handler) DeleteApp

func (h *Handler) DeleteApp(ctx context.Context, appID string) error

DeleteApp uninstalls an app

func (*Handler) GetAction

func (h *Handler) GetAction(ctx context.Context, fullName string) (*AppAction, error)

GetAction returns a single action addressed as "app-id:action-name", the form workflow definitions use.

func (*Handler) GetApp

func (h *Handler) GetApp(ctx context.Context, appID string) (*App, error)

GetApp gets a specific app by ID

func (*Handler) GetFunction

func (h *Handler) GetFunction(ctx context.Context, fullName string) (*AppFunction, error)

GetFunction gets details about a specific function

func (*Handler) ListActions

func (h *Handler) ListActions(ctx context.Context, opts ListActionsOptions) ([]AppAction, error)

ListActions lists the actions of installed apps.

Query and Filter are sent upstream; AppID is applied here, so it needs no filter-expression quoting and cannot collide with a caller's Filter.

func (*Handler) ListApps

func (h *Handler) ListApps(ctx context.Context) (*AppList, error)

ListApps lists all installed apps

func (*Handler) ListFunctions

func (h *Handler) ListFunctions(ctx context.Context, appIDFilter string) ([]AppFunction, error)

ListFunctions lists all functions across apps (or filtered by app ID)

type ListActionsOptions

type ListActionsOptions struct {
	// AppID keeps only the actions of one app, by exact id.
	AppID string

	// Query is a whitespace-separated list of search terms. Each term must
	// appear in the app id, app name, action name, title or description;
	// terms are case-insensitive and each one narrows further.
	Query string

	// Filter is a platform filter expression on app.id and the action's
	// fields, nested paths included, e.g.
	// "not (action.docs.inputSchema is-empty)". It is sent as is; combined
	// with Query, an action must match both.
	Filter string
}

ListActionsOptions narrows what ListActions returns.

type ModificationInfo

type ModificationInfo struct {
	CreatedBy      string `json:"createdBy,omitempty"`
	CreatedAt      string `json:"createdAt,omitempty"`
	LastModifiedBy string `json:"lastModifiedBy,omitempty"`
	LastModifiedAt string `json:"lastModifiedAt,omitempty"`
}

ModificationInfo contains modification timestamps

type ResourceStatus

type ResourceStatus struct {
	Status              string   `json:"status"`
	SubResourceTypes    []string `json:"subResourceTypes,omitempty"`
	SubResourceStatuses []string `json:"subResourceStatuses,omitempty"`
}

ResourceStatus represents the status of an app's resources

type SDKVersionsResponse

type SDKVersionsResponse struct {
	LayerVersion string              `json:"layerVersion"`
	Packages     map[string][]string `json:"packages"`
}

SDKVersionsResponse represents the SDK versions response: the SDK layer version plus, per SDK package, every version the function executor offers.

type SignatureInfo

type SignatureInfo struct {
	Signature string `json:"signature,omitempty"`
}

SignatureInfo represents signature information for an app

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL