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: 13 Imported by: ? modules, 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 (
	MaxActionQueryLength  = sdkae.MaxActionQueryLength
	MaxActionFilterLength = sdkae.MaxActionFilterLength
)

Variables

This section is empty.

Functions

func ReadFileOrStdin

func ReadFileOrStdin(filename string) (string, error)

ReadFileOrStdin reads content from a file (through the vfs seam, so embedded invocations resolve virtual request files) or stdin. This is a CLI-layer helper and intentionally not part of the SDK.

func ReadFileOrStdinWith

func ReadFileOrStdinWith(env vfs.Env, filename string) (string, error)

ReadFileOrStdinWith is ReadFileOrStdin through the given invocation Env.

Types

type App

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

App represents an installed app (CLI version with table tags).

type AppAction

type AppAction struct {
	AppID       string `json:"appId" yaml:"appId" table:"APP_ID"`
	ActionName  string `json:"actionName" yaml:"actionName" table:"ACTION"`
	Title       string `json:"title,omitempty" yaml:"title,omitempty" table:"TITLE"`
	Description string `json:"description,omitempty" yaml:"description,omitempty" table:"DESCRIPTION,wide"`
	Stateful    bool   `json:"stateful,omitempty" yaml:"stateful,omitempty" table:"STATEFUL,wide"`
	Approval    bool   `json:"approval,omitempty" yaml:"approval,omitempty" table:"APPROVAL,wide"`
	FullName    string `json:"fullName" yaml:"fullName" table:"FULL_NAME"`

	// Extra holds the manifest attributes with no typed field; MarshalJSON
	// emits them inline.
	Extra map[string]json.RawMessage `json:"-" yaml:"-" table:"-"`
}

func (AppAction) MarshalJSON

func (a AppAction) MarshalJSON() ([]byte, error)

MarshalJSON emits the modelled fields, then each Extra attribute under its own name. A manifest attribute that collides with a modelled field is dropped: the typed field wins.

func (AppAction) MarshalYAML

func (a AppAction) MarshalYAML() (any, error)

type AppFunction

type AppFunction struct {
	AppID        string `json:"appId" table:"APP_ID,wide"`
	AppName      string `json:"appName" table:"APP"`
	FunctionName string `json:"functionName" table:"FUNCTION"`
	Title        string `json:"title,omitempty" table:"TITLE,wide"`
	Description  string `json:"description,omitempty" table:"DESCRIPTION,wide"`
	Resumable    bool   `json:"resumable" table:"RESUMABLE,wide"`
	Stateful     bool   `json:"stateful,omitempty" table:"STATEFUL,wide"`
	FullName     string `json:"fullName" table:"FULL_NAME"`
}

AppFunction represents a function within an app (CLI version with table tags).

type AppList

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

AppList represents a list of apps.

type DeferredExecutionRequest

type DeferredExecutionRequest = sdkae.DeferredExecutionRequest

Re-export SDK types that have no table tags.

type DeferredExecutionResponse

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

DeferredExecutionResponse represents a deferred execution response (CLI version with table tags).

type FunctionExecutorRequest

type FunctionExecutorRequest = sdkae.FunctionExecutorRequest

Re-export SDK types that have no table tags.

type FunctionExecutorResponse

type FunctionExecutorResponse = sdkae.FunctionExecutorResponse

Re-export SDK types that have no table tags.

type FunctionHandler

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

FunctionHandler handles App Engine function operations.

func NewFunctionHandler

func NewFunctionHandler(c *client.Client) *FunctionHandler

NewFunctionHandler creates a new function handler

func (*FunctionHandler) DeferExecution

DeferExecution defers execution of a resumable function

func (*FunctionHandler) DiscoverSchema

func (h *FunctionHandler) DiscoverSchema(appID, functionName string) (*FunctionSchema, error)

DiscoverSchema attempts to discover the schema of a function by calling it with an empty payload

func (*FunctionHandler) ExecuteRequest

ExecuteRequest executes a prepared ad-hoc function executor request

func (*FunctionHandler) GetSDKVersions

func (h *FunctionHandler) GetSDKVersions() (*SDKVersionsResponse, error)

GetSDKVersions lists available SDK versions as returned by the function executor

func (*FunctionHandler) InvokeFunction

InvokeFunction invokes an app function

type FunctionInvokeRequest

type FunctionInvokeRequest = sdkae.FunctionInvokeRequest

Re-export SDK types that have no table tags.

type FunctionInvokeResponse

type FunctionInvokeResponse = sdkae.FunctionInvokeResponse

Re-export SDK types that have no table tags.

type FunctionSchema

type FunctionSchema struct {
	FunctionName string
	AppID        string
	Fields       []SchemaField
	ErrorMessage string
}

FunctionSchema represents the discovered schema of a function

func (*FunctionSchema) FormatSchema

func (s *FunctionSchema) FormatSchema() string

FormatSchema formats a schema for display

func (*FunctionSchema) GenerateExamplePayload

func (s *FunctionSchema) GenerateExamplePayload() string

GenerateExamplePayload generates an example JSON payload based on discovered schema

type Handler

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

Handler handles App Engine resources.

func NewHandler

func NewHandler(c *client.Client) *Handler

NewHandler creates a new App Engine handler

func (*Handler) DeleteApp

func (h *Handler) DeleteApp(appID string) error

DeleteApp uninstalls an app

func (*Handler) GetAction

func (h *Handler) GetAction(fullName string) (*AppAction, error)

func (*Handler) GetApp

func (h *Handler) GetApp(appID string) (*App, error)

GetApp gets a specific app by ID

func (*Handler) GetFunction

func (h *Handler) GetFunction(fullName string) (*AppFunction, error)

GetFunction gets details about a specific function

func (*Handler) ListActions

func (h *Handler) ListActions(opts ListActionsOptions) ([]AppAction, error)

func (*Handler) ListApps

func (h *Handler) ListApps() (*AppList, error)

ListApps lists all installed apps

func (*Handler) ListFunctions

func (h *Handler) ListFunctions(appIDFilter string) ([]AppFunction, error)

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

type Intent

type Intent struct {
	AppID         string                    `json:"appId" table:"APP_ID,wide"`
	AppName       string                    `json:"appName" table:"APP"`
	IntentID      string                    `json:"intentId" table:"INTENT_ID"`
	Description   string                    `json:"description" table:"DESCRIPTION"`
	Properties    map[string]IntentProperty `json:"properties,omitempty" table:"-"`
	FullName      string                    `json:"fullName" table:"FULL_NAME"`
	RequiredProps []string                  `json:"requiredProps,omitempty" table:"REQUIRED"`

	// Name is the declaration's human-readable label, as declared.
	Name string `json:"name,omitempty" yaml:",omitempty" table:"-"`
	// Deprecated is true when the app marks the intent deprecated.
	Deprecated bool `json:"deprecated,omitempty" yaml:",omitempty" table:"-"`
	// DeprecationMessage is the app's note when `deprecated` is a string.
	DeprecationMessage string `json:"deprecationMessage,omitempty" yaml:",omitempty" table:"-"`
}

Intent represents an app intent from the manifest

func (Intent) SortedPropertyNames

func (i Intent) SortedPropertyNames() []string

SortedPropertyNames returns the intent's property names in sorted order.

type IntentHandler

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

IntentHandler handles App Engine intent operations

func NewIntentHandler

func NewIntentHandler(c *client.Client) *IntentHandler

NewIntentHandler creates a new intent handler

func (*IntentHandler) FindIntentsForData

func (h *IntentHandler) FindIntentsForData(data map[string]interface{}) ([]IntentMatch, error)

FindIntentsForData finds intents that match the given data

func (*IntentHandler) GenerateIntentURL

func (h *IntentHandler) GenerateIntentURL(appID, intentID string, payload map[string]interface{}) (string, error)

GenerateIntentURL generates an intent URL for the given app, intent, and payload

func (*IntentHandler) GetIntent

func (h *IntentHandler) GetIntent(fullName string) (*Intent, error)

GetIntent gets details about a specific intent

func (*IntentHandler) ListIntents

func (h *IntentHandler) ListIntents(appIDFilter string) ([]Intent, error)

ListIntents lists all intents across apps (or filtered by app ID)

type IntentMatch

type IntentMatch struct {
	Intent
	MatchQuality float64  `json:"matchQuality" table:"MATCH%"`
	MatchedProps []string `json:"matchedProps,omitempty" table:"-"`
	MissingProps []string `json:"missingProps,omitempty" table:"-"`
	// MatchedKeys maps each matched property to the key in the data that
	// satisfied it: the key to send when opening the intent.
	MatchedKeys map[string]string `json:"matchedKeys,omitempty" yaml:",omitempty" table:"-"`
}

IntentMatch represents a matched intent with quality score

type IntentProperty

type IntentProperty struct {
	// Type is the declared JSON-schema type. It is empty when the declaration
	// names none: dtctl does not guess one. A list-form type
	// (`type: ["string", "array"]`), or different types across the keys of a
	// plural `schemas` declaration, is joined with "|"; Types has the list.
	Type        string `json:"type"`
	Required    bool   `json:"required"`
	Format      string `json:"format,omitempty"`
	Description string `json:"description,omitempty"`

	// Types lists every declared type without duplicates, in declaration
	// order (for `schemas`, in accepted-key order).
	Types []string `json:"types,omitempty" yaml:",omitempty"`
	// AcceptedKeys are the payload keys that satisfy this property: the
	// property name for the singular form, the `schemas` keys (sorted) for
	// the plural one. Always present; an empty list means the app declared
	// `schemas: {}`, which no payload can satisfy.
	AcceptedKeys []string `json:"acceptedKeys"`
	// Schema is the singular `schema` exactly as declared (pattern, enum,
	// items, nested properties and required, ...).
	Schema map[string]interface{} `json:"schema,omitempty" yaml:",omitempty"`
	// Schemas is the plural `schemas` map exactly as declared, keyed by
	// accepted payload key.
	Schemas map[string]interface{} `json:"schemas,omitempty" yaml:",omitempty"`
}

IntentProperty represents a property definition in an intent.

An app declares a property in one of two forms:

  • singular `schema`: the property name is the payload key, governed by that one schema;
  • plural `schemas`: a map whose keys are the payload keys the intent accepts for this property (aliases such as `dt.entity` or `id`), each with its own schema. The property name is then only a label: a payload can carry it only when it is also one of the keys.

Type, Required, Format and Description predate the plural form and keep their meaning. Everything else the declaration carries is exposed next to them rather than folded into them, so -o json/yaml show what the app declared.

func (IntentProperty) KeyPattern

func (p IntentProperty) KeyPattern(propName, key string) string

KeyPattern returns the `pattern` the schema of one accepted key declares, or "" when it declares none.

type ListActionsOptions

type ListActionsOptions = sdkae.ListActionsOptions

type ModificationInfo

type ModificationInfo = sdkae.ModificationInfo

Re-export SDK types that have no table tags.

type ResourceStatus

type ResourceStatus = sdkae.ResourceStatus

Re-export SDK types that have no table tags.

type SDKVersionsResponse

type SDKVersionsResponse = sdkae.SDKVersionsResponse

Re-export SDK types that have no table tags.

type SchemaField

type SchemaField struct {
	Name     string
	Type     string
	Required bool
	Hint     string
}

SchemaField represents a field in the function schema

type SignatureInfo

type SignatureInfo = sdkae.SignatureInfo

Re-export SDK types that have no table tags.

Jump to

Keyboard shortcuts

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