function

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package function builds and packages function archives for upload.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Package

type Package struct {
	Name        string
	Runtime     string
	Handler     string
	ArchiveData []byte
	Size        int64
}

Package contains one function source archive ready for API upload.

func PackageSource

func PackageSource(info SourceInfo, baseDir string) (*Package, error)

PackageSource packages a cloud function source bundle with manifests and shared libraries.

type RuntimeCatalog

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

RuntimeCatalog indexes API-provided default runtime metadata for local source detection.

func RuntimeCatalogFromOptions

func RuntimeCatalogFromOptions(options []apiclient.FunctionRuntimeOption) RuntimeCatalog

RuntimeCatalogFromOptions converts the API runtime catalog to scanner/package metadata.

type Service

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

Service performs authenticated Volcano function workflows.

func NewService

func NewService(deps cliruntime.Deps) Service

NewService returns a function service.

func (Service) CreateSchedulerByID

func (s Service) CreateSchedulerByID(ctx context.Context, functionID uuid.UUID, input api.FunctionSchedulerInput) (*apiclient.FunctionScheduler, error)

CreateSchedulerByID creates one scheduler for the given function ID.

func (Service) DeleteByID

func (s Service) DeleteByID(ctx context.Context, functionID uuid.UUID) error

DeleteByID starts deleting one function by ID.

func (Service) DeleteScheduler

func (s Service) DeleteScheduler(ctx context.Context, identifier string, schedulerID uuid.UUID) error

DeleteScheduler deletes one scheduler for a function.

func (Service) DeployPackage

func (s Service) DeployPackage(ctx context.Context, pkg Package) (*apiclient.Function, error)

DeployPackage deploys one packaged function source archive.

func (Service) DeployPackageBatch

func (s Service) DeployPackageBatch(ctx context.Context, packages []Package) (*apiclient.BatchFunctionDeployResponse, error)

DeployPackageBatch deploys one batch of packaged function source archives.

func (Service) DeploymentLogs

func (s Service) DeploymentLogs(ctx context.Context, functionID, deploymentID uuid.UUID, limit int, nextToken string) (*apiclient.GetLogsResponse, error)

DeploymentLogs returns one build log page for a function deployment.

func (Service) DisableScheduler

func (s Service) DisableScheduler(ctx context.Context, identifier string, schedulerID uuid.UUID) (*apiclient.FunctionScheduler, error)

DisableScheduler disables one scheduler for a function.

func (Service) EnableScheduler

func (s Service) EnableScheduler(ctx context.Context, identifier string, schedulerID uuid.UUID) (*apiclient.FunctionScheduler, error)

EnableScheduler enables one scheduler for a function.

func (Service) Get

func (s Service) Get(ctx context.Context, identifier string) (*apiclient.Function, error)

Get returns one function by normalized name/path or UUID.

func (Service) ListPage

func (s Service) ListPage(ctx context.Context, page, limit int) (*apiclient.PaginatedFunctions, error)

ListPage returns one function page in the current project.

func (Service) ListRuntimes

func (s Service) ListRuntimes(ctx context.Context) ([]apiclient.FunctionRuntimeOption, error)

ListRuntimes returns the function runtime catalog.

func (Service) ListSchedulers

ListSchedulers returns schedulers configured for a function.

func (Service) Resolve

func (s Service) Resolve(ctx context.Context, identifier string) (*apiclient.Function, error)

Resolve returns a function by normalized name/path or UUID in the current project.

func (Service) ResolveDeployment

func (s Service) ResolveDeployment(ctx context.Context, functionID uuid.UUID, deploymentID string) (*apiclient.FunctionDeployment, error)

ResolveDeployment returns a deployment by ID, paging internally.

func (Service) RuntimeCatalog

func (s Service) RuntimeCatalog(ctx context.Context) (RuntimeCatalog, error)

RuntimeCatalog returns deploy runtime metadata from the function runtime catalog.

func (Service) RuntimeLogs

func (s Service) RuntimeLogs(ctx context.Context, functionID uuid.UUID, limit int, nextToken string) (*apiclient.GetLogsResponse, error)

RuntimeLogs returns one runtime log page for a function.

func (Service) UpdateVisibility

func (s Service) UpdateVisibility(ctx context.Context, identifier string, isPublic bool) (*apiclient.Function, error)

UpdateVisibility updates one function's public/private visibility.

type SharedLibrary

type SharedLibrary struct {
	Path  string
	Name  string
	IsDir bool
}

SharedLibrary represents a shared function library file or directory.

func FindSharedLibraries

func FindSharedLibraries(baseDir string) ([]SharedLibrary, error)

FindSharedLibraries finds underscore-prefixed files and directories below volcano/ and volcano/functions/.

type SourceInfo

type SourceInfo struct {
	Path    string
	Name    string
	Runtime apiclient.FunctionRuntimeOption
	IsDir   bool
}

SourceInfo represents one discovered deployable function source.

func ScanSources

func ScanSources(baseDir string, catalog RuntimeCatalog) ([]SourceInfo, error)

ScanSources scans volcano/functions for top-level function files and directories.

Jump to

Keyboard shortcuts

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