Documentation
¶
Overview ¶
Package gateway is the single source of truth for Edge Function branch-gateway operations: the endpoint paths, request body structures, and HTTP calls for deploy / get / body / delete are defined once here and shared by CLI commands (internal/functions/*) and MCP tools. Callers are responsible only for assembling the request (CLI reads files from disk; MCP takes code from string parameters); all transport details are handled here.
Index ¶
- func Delete(ctx context.Context, access volcengine.PgMetaAccess, slug string) error
- func Deploy(ctx context.Context, access volcengine.PgMetaAccess, req DeployRequest) ([]byte, error)
- func GetMetadata(ctx context.Context, access volcengine.PgMetaAccess, slug string) ([]byte, error)
- func IsNotFound(err error) bool
- type BodyResponse
- type DeployMetadata
- type DeployRequest
- type File
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(ctx context.Context, access volcengine.PgMetaAccess, slug string) error
Delete deletes an Edge Function.
func Deploy ¶
func Deploy(ctx context.Context, access volcengine.PgMetaAccess, req DeployRequest) ([]byte, error)
Deploy creates or updates an Edge Function and returns the raw gateway response body.
func GetMetadata ¶
func GetMetadata(ctx context.Context, access volcengine.PgMetaAccess, slug string) ([]byte, error)
GetMetadata fetches the metadata of a single Edge Function as raw JSON.
func IsNotFound ¶
IsNotFound reports whether a gateway error is a 404 (function not found).
Types ¶
type BodyResponse ¶
BodyResponse is the set of source files returned by the function body endpoint.
func GetBody ¶
func GetBody(ctx context.Context, access volcengine.PgMetaAccess, slug string) (BodyResponse, error)
GetBody fetches the source files of an Edge Function.
type DeployMetadata ¶
type DeployMetadata struct {
EntrypointPath string `json:"entrypoint_path"`
Name string `json:"name"`
Runtime string `json:"runtime"`
VerifyJWT *bool `json:"verify_jwt,omitempty"`
ImportMapPath string `json:"import_map_path,omitempty"`
}
DeployMetadata is the metadata for a deploy request.
type DeployRequest ¶
type DeployRequest struct {
ProjectRef string `json:"projectRef,omitempty"`
Slug string `json:"slug,omitempty"`
Metadata DeployMetadata `json:"metadata"`
Files []File `json:"files"`
}
DeployRequest is the request body for a deploy call.