function

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BundleFlags = []string{
		"--decorator", "tc39",
	}
)
View Source
var ErrNoDeploy = errors.New("All Functions are up to date.")

Functions

func Compress

func Compress(r io.Reader, w io.Writer) error

func WithBundler

func WithBundler(bundler EszipBundler) withOption

func WithMaxJobs

func WithMaxJobs(maxJobs uint) withOption

Types

type EdgeRuntimeAPI

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

func NewEdgeRuntimeAPI

func NewEdgeRuntimeAPI(project string, client api.ClientWithResponses, opts ...withOption) EdgeRuntimeAPI

func (*EdgeRuntimeAPI) Deploy

func (s *EdgeRuntimeAPI) Deploy(ctx context.Context, functionConfig config.FunctionConfig, fsys fs.FS) error

func (*EdgeRuntimeAPI) UpsertFunctions

func (s *EdgeRuntimeAPI) UpsertFunctions(ctx context.Context, functionConfig config.FunctionConfig, filter ...func(string) bool) error

type EszipBundler

type EszipBundler interface {
	Bundle(ctx context.Context, slug, entrypoint, importMap string, staticFiles []string, output io.Writer) (FunctionDeployMetadata, error)
}

func NewNativeBundler

func NewNativeBundler(tempDir string, fsys fs.FS) EszipBundler

type FunctionDeployMetadata

type FunctionDeployMetadata struct {
	EntrypointPath string    `json:"entrypoint_path"`
	ImportMapPath  *string   `json:"import_map_path,omitempty"`
	Name           *string   `json:"name,omitempty"`
	StaticPatterns *[]string `json:"static_patterns,omitempty"`
	VerifyJwt      *bool     `json:"verify_jwt,omitempty"`
	SHA256         string    `json:"sha256,omitempty"`
}

func NewMetadata

func NewMetadata(slug, entrypoint, importMap string, staticFiles []string) FunctionDeployMetadata

type ImportMap

type ImportMap struct {
	Imports map[string]string            `json:"imports"`
	Scopes  map[string]map[string]string `json:"scopes"`
	// Fallback reference for deno.json
	ImportMap string `json:"importMap"`
}

func (*ImportMap) IsReference

func (m *ImportMap) IsReference() bool

func (*ImportMap) Load

func (m *ImportMap) Load(imPath string, fsys fs.FS, opts ...func(string, io.Reader) error) error

func (*ImportMap) LoadAsDeno

func (m *ImportMap) LoadAsDeno(imPath string, fsys fs.FS, opts ...func(string, io.Reader) error) error

func (*ImportMap) Parse

func (m *ImportMap) Parse(data []byte) error

func (*ImportMap) Resolve

func (m *ImportMap) Resolve(imPath string) error

func (*ImportMap) WalkImportPaths

func (importMap *ImportMap) WalkImportPaths(srcPath string, readFile func(curr string, w io.Writer) error) error

Jump to

Keyboard shortcuts

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