functions

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateDeploymentOption

type CreateDeploymentOption func(*CreateDeploymentOptions)

type CreateDeploymentOptions

type CreateDeploymentOptions struct {
	Entrypoint string
	Commands   string
	// contains filtered or unexported fields
}

func (CreateDeploymentOptions) New

type CreateDuplicateDeploymentOption added in v0.7.0

type CreateDuplicateDeploymentOption func(*CreateDuplicateDeploymentOptions)

type CreateDuplicateDeploymentOptions added in v0.7.0

type CreateDuplicateDeploymentOptions struct {
	BuildId string
	// contains filtered or unexported fields
}

func (CreateDuplicateDeploymentOptions) New added in v0.7.0

type CreateExecutionOption

type CreateExecutionOption func(*CreateExecutionOptions)

type CreateExecutionOptions

type CreateExecutionOptions struct {
	Body        string
	Async       bool
	Path        string
	Method      string
	Headers     interface{}
	ScheduledAt string
	// contains filtered or unexported fields
}

func (CreateExecutionOptions) New

type CreateOption

type CreateOption func(*CreateOptions)

type CreateOptions

type CreateOptions struct {
	Execute               []string
	Events                []string
	Schedule              string
	Timeout               int
	Enabled               bool
	Logging               bool
	Entrypoint            string
	Commands              string
	Scopes                []string
	InstallationId        string
	ProviderRepositoryId  string
	ProviderBranch        string
	ProviderSilentMode    bool
	ProviderRootDirectory string
	Specification         string
	// contains filtered or unexported fields
}

func (CreateOptions) New

func (options CreateOptions) New() *CreateOptions

type CreateTemplateDeploymentOption added in v0.7.0

type CreateTemplateDeploymentOption func(*CreateTemplateDeploymentOptions)

type CreateTemplateDeploymentOptions added in v0.7.0

type CreateTemplateDeploymentOptions struct {
	Activate bool
	// contains filtered or unexported fields
}

func (CreateTemplateDeploymentOptions) New added in v0.7.0

type CreateVariableOption added in v0.7.0

type CreateVariableOption func(*CreateVariableOptions)

type CreateVariableOptions added in v0.7.0

type CreateVariableOptions struct {
	Secret bool
	// contains filtered or unexported fields
}

func (CreateVariableOptions) New added in v0.7.0

type CreateVcsDeploymentOption added in v0.7.0

type CreateVcsDeploymentOption func(*CreateVcsDeploymentOptions)

type CreateVcsDeploymentOptions added in v0.7.0

type CreateVcsDeploymentOptions struct {
	Activate bool
	// contains filtered or unexported fields
}

func (CreateVcsDeploymentOptions) New added in v0.7.0

type Functions

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

Functions service

func New

func New(clt client.Client) *Functions

func (*Functions) Create

func (srv *Functions) Create(FunctionId string, Name string, Runtime string, optionalSetters ...CreateOption) (*models.Function, error)

Create create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API.

func (*Functions) CreateDeployment

func (srv *Functions) CreateDeployment(FunctionId string, Code file.InputFile, Activate bool, optionalSetters ...CreateDeploymentOption) (*models.Deployment, error)

CreateDeployment create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.

This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https://appwrite.io/docs/functions).

Use the "command" param to set the entrypoint used to execute your code.

func (*Functions) CreateDuplicateDeployment added in v0.7.0

func (srv *Functions) CreateDuplicateDeployment(FunctionId string, DeploymentId string, optionalSetters ...CreateDuplicateDeploymentOption) (*models.Deployment, error)

CreateDuplicateDeployment create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.

func (*Functions) CreateExecution

func (srv *Functions) CreateExecution(FunctionId string, optionalSetters ...CreateExecutionOption) (*models.Execution, error)

CreateExecution trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.

func (*Functions) CreateTemplateDeployment added in v0.7.0

func (srv *Functions) CreateTemplateDeployment(FunctionId string, Repository string, Owner string, RootDirectory string, Version string, optionalSetters ...CreateTemplateDeploymentOption) (*models.Deployment, error)

CreateTemplateDeployment create a deployment based on a template.

Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/functions/templates) to find the template details.

func (*Functions) CreateVariable

func (srv *Functions) CreateVariable(FunctionId string, Key string, Value string, optionalSetters ...CreateVariableOption) (*models.Variable, error)

CreateVariable create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.

func (*Functions) CreateVcsDeployment added in v0.7.0

func (srv *Functions) CreateVcsDeployment(FunctionId string, Type string, Reference string, optionalSetters ...CreateVcsDeploymentOption) (*models.Deployment, error)

CreateVcsDeployment create a deployment when a function is connected to VCS.

This endpoint lets you create deployment from a branch, commit, or a tag.

func (*Functions) Delete

func (srv *Functions) Delete(FunctionId string) (*interface{}, error)

Delete delete a function by its unique ID.

func (*Functions) DeleteDeployment

func (srv *Functions) DeleteDeployment(FunctionId string, DeploymentId string) (*interface{}, error)

DeleteDeployment delete a code deployment by its unique ID.

func (*Functions) DeleteExecution

func (srv *Functions) DeleteExecution(FunctionId string, ExecutionId string) (*interface{}, error)

DeleteExecution delete a function execution by its unique ID.

func (*Functions) DeleteVariable

func (srv *Functions) DeleteVariable(FunctionId string, VariableId string) (*interface{}, error)

DeleteVariable delete a variable by its unique ID.

func (*Functions) Get

func (srv *Functions) Get(FunctionId string) (*models.Function, error)

Get get a function by its unique ID.

func (*Functions) GetDeployment

func (srv *Functions) GetDeployment(FunctionId string, DeploymentId string) (*models.Deployment, error)

GetDeployment get a function deployment by its unique ID.

func (*Functions) GetDeploymentDownload

func (srv *Functions) GetDeploymentDownload(FunctionId string, DeploymentId string, optionalSetters ...GetDeploymentDownloadOption) (*[]byte, error)

GetDeploymentDownload get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.

func (*Functions) GetExecution

func (srv *Functions) GetExecution(FunctionId string, ExecutionId string) (*models.Execution, error)

GetExecution get a function execution log by its unique ID.

func (*Functions) GetVariable

func (srv *Functions) GetVariable(FunctionId string, VariableId string) (*models.Variable, error)

GetVariable get a variable by its unique ID.

func (*Functions) List

func (srv *Functions) List(optionalSetters ...ListOption) (*models.FunctionList, error)

List get a list of all the project's functions. You can use the query params to filter your results.

func (*Functions) ListDeployments

func (srv *Functions) ListDeployments(FunctionId string, optionalSetters ...ListDeploymentsOption) (*models.DeploymentList, error)

ListDeployments get a list of all the function's code deployments. You can use the query params to filter your results.

func (*Functions) ListExecutions

func (srv *Functions) ListExecutions(FunctionId string, optionalSetters ...ListExecutionsOption) (*models.ExecutionList, error)

ListExecutions get a list of all the current user function execution logs. You can use the query params to filter your results.

func (*Functions) ListRuntimes

func (srv *Functions) ListRuntimes() (*models.RuntimeList, error)

ListRuntimes get a list of all runtimes that are currently active on your instance.

func (*Functions) ListSpecifications

func (srv *Functions) ListSpecifications() (*models.SpecificationList, error)

ListSpecifications list allowed function specifications for this instance.

func (*Functions) ListVariables

func (srv *Functions) ListVariables(FunctionId string) (*models.VariableList, error)

ListVariables get a list of all variables of a specific function.

func (*Functions) Update

func (srv *Functions) Update(FunctionId string, Name string, optionalSetters ...UpdateOption) (*models.Function, error)

Update update function by its unique ID.

func (*Functions) UpdateDeploymentStatus added in v0.7.0

func (srv *Functions) UpdateDeploymentStatus(FunctionId string, DeploymentId string) (*models.Deployment, error)

UpdateDeploymentStatus cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.

func (*Functions) UpdateFunctionDeployment added in v0.7.0

func (srv *Functions) UpdateFunctionDeployment(FunctionId string, DeploymentId string) (*models.Function, error)

UpdateFunctionDeployment update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.

func (*Functions) UpdateVariable

func (srv *Functions) UpdateVariable(FunctionId string, VariableId string, Key string, optionalSetters ...UpdateVariableOption) (*models.Variable, error)

UpdateVariable update variable by its unique ID.

func (*Functions) WithCreateCommands

func (srv *Functions) WithCreateCommands(v string) CreateOption

func (*Functions) WithCreateDeploymentCommands

func (srv *Functions) WithCreateDeploymentCommands(v string) CreateDeploymentOption

func (*Functions) WithCreateDeploymentEntrypoint

func (srv *Functions) WithCreateDeploymentEntrypoint(v string) CreateDeploymentOption

func (*Functions) WithCreateDuplicateDeploymentBuildId added in v0.7.0

func (srv *Functions) WithCreateDuplicateDeploymentBuildId(v string) CreateDuplicateDeploymentOption

func (*Functions) WithCreateEnabled

func (srv *Functions) WithCreateEnabled(v bool) CreateOption

func (*Functions) WithCreateEntrypoint

func (srv *Functions) WithCreateEntrypoint(v string) CreateOption

func (*Functions) WithCreateEvents

func (srv *Functions) WithCreateEvents(v []string) CreateOption

func (*Functions) WithCreateExecute

func (srv *Functions) WithCreateExecute(v []string) CreateOption

func (*Functions) WithCreateExecutionAsync

func (srv *Functions) WithCreateExecutionAsync(v bool) CreateExecutionOption

func (*Functions) WithCreateExecutionBody

func (srv *Functions) WithCreateExecutionBody(v string) CreateExecutionOption

func (*Functions) WithCreateExecutionHeaders

func (srv *Functions) WithCreateExecutionHeaders(v interface{}) CreateExecutionOption

func (*Functions) WithCreateExecutionMethod

func (srv *Functions) WithCreateExecutionMethod(v string) CreateExecutionOption

func (*Functions) WithCreateExecutionPath

func (srv *Functions) WithCreateExecutionPath(v string) CreateExecutionOption

func (*Functions) WithCreateExecutionScheduledAt

func (srv *Functions) WithCreateExecutionScheduledAt(v string) CreateExecutionOption

func (*Functions) WithCreateInstallationId

func (srv *Functions) WithCreateInstallationId(v string) CreateOption

func (*Functions) WithCreateLogging

func (srv *Functions) WithCreateLogging(v bool) CreateOption

func (*Functions) WithCreateProviderBranch

func (srv *Functions) WithCreateProviderBranch(v string) CreateOption

func (*Functions) WithCreateProviderRepositoryId

func (srv *Functions) WithCreateProviderRepositoryId(v string) CreateOption

func (*Functions) WithCreateProviderRootDirectory

func (srv *Functions) WithCreateProviderRootDirectory(v string) CreateOption

func (*Functions) WithCreateProviderSilentMode

func (srv *Functions) WithCreateProviderSilentMode(v bool) CreateOption

func (*Functions) WithCreateSchedule

func (srv *Functions) WithCreateSchedule(v string) CreateOption

func (*Functions) WithCreateScopes

func (srv *Functions) WithCreateScopes(v []string) CreateOption

func (*Functions) WithCreateSpecification

func (srv *Functions) WithCreateSpecification(v string) CreateOption

func (*Functions) WithCreateTemplateDeploymentActivate added in v0.7.0

func (srv *Functions) WithCreateTemplateDeploymentActivate(v bool) CreateTemplateDeploymentOption

func (*Functions) WithCreateTimeout

func (srv *Functions) WithCreateTimeout(v int) CreateOption

func (*Functions) WithCreateVariableSecret added in v0.7.0

func (srv *Functions) WithCreateVariableSecret(v bool) CreateVariableOption

func (*Functions) WithCreateVcsDeploymentActivate added in v0.7.0

func (srv *Functions) WithCreateVcsDeploymentActivate(v bool) CreateVcsDeploymentOption

func (*Functions) WithGetDeploymentDownloadType added in v0.7.0

func (srv *Functions) WithGetDeploymentDownloadType(v string) GetDeploymentDownloadOption

func (*Functions) WithListDeploymentsQueries

func (srv *Functions) WithListDeploymentsQueries(v []string) ListDeploymentsOption

func (*Functions) WithListDeploymentsSearch

func (srv *Functions) WithListDeploymentsSearch(v string) ListDeploymentsOption

func (*Functions) WithListExecutionsQueries

func (srv *Functions) WithListExecutionsQueries(v []string) ListExecutionsOption

func (*Functions) WithListQueries

func (srv *Functions) WithListQueries(v []string) ListOption

func (*Functions) WithListSearch

func (srv *Functions) WithListSearch(v string) ListOption

func (*Functions) WithUpdateCommands

func (srv *Functions) WithUpdateCommands(v string) UpdateOption

func (*Functions) WithUpdateEnabled

func (srv *Functions) WithUpdateEnabled(v bool) UpdateOption

func (*Functions) WithUpdateEntrypoint

func (srv *Functions) WithUpdateEntrypoint(v string) UpdateOption

func (*Functions) WithUpdateEvents

func (srv *Functions) WithUpdateEvents(v []string) UpdateOption

func (*Functions) WithUpdateExecute

func (srv *Functions) WithUpdateExecute(v []string) UpdateOption

func (*Functions) WithUpdateInstallationId

func (srv *Functions) WithUpdateInstallationId(v string) UpdateOption

func (*Functions) WithUpdateLogging

func (srv *Functions) WithUpdateLogging(v bool) UpdateOption

func (*Functions) WithUpdateProviderBranch

func (srv *Functions) WithUpdateProviderBranch(v string) UpdateOption

func (*Functions) WithUpdateProviderRepositoryId

func (srv *Functions) WithUpdateProviderRepositoryId(v string) UpdateOption

func (*Functions) WithUpdateProviderRootDirectory

func (srv *Functions) WithUpdateProviderRootDirectory(v string) UpdateOption

func (*Functions) WithUpdateProviderSilentMode

func (srv *Functions) WithUpdateProviderSilentMode(v bool) UpdateOption

func (*Functions) WithUpdateRuntime

func (srv *Functions) WithUpdateRuntime(v string) UpdateOption

func (*Functions) WithUpdateSchedule

func (srv *Functions) WithUpdateSchedule(v string) UpdateOption

func (*Functions) WithUpdateScopes

func (srv *Functions) WithUpdateScopes(v []string) UpdateOption

func (*Functions) WithUpdateSpecification

func (srv *Functions) WithUpdateSpecification(v string) UpdateOption

func (*Functions) WithUpdateTimeout

func (srv *Functions) WithUpdateTimeout(v int) UpdateOption

func (*Functions) WithUpdateVariableSecret added in v0.7.0

func (srv *Functions) WithUpdateVariableSecret(v bool) UpdateVariableOption

func (*Functions) WithUpdateVariableValue

func (srv *Functions) WithUpdateVariableValue(v string) UpdateVariableOption

type GetDeploymentDownloadOption added in v0.7.0

type GetDeploymentDownloadOption func(*GetDeploymentDownloadOptions)

type GetDeploymentDownloadOptions added in v0.7.0

type GetDeploymentDownloadOptions struct {
	Type string
	// contains filtered or unexported fields
}

func (GetDeploymentDownloadOptions) New added in v0.7.0

type ListDeploymentsOption

type ListDeploymentsOption func(*ListDeploymentsOptions)

type ListDeploymentsOptions

type ListDeploymentsOptions struct {
	Queries []string
	Search  string
	// contains filtered or unexported fields
}

func (ListDeploymentsOptions) New

type ListExecutionsOption

type ListExecutionsOption func(*ListExecutionsOptions)

type ListExecutionsOptions

type ListExecutionsOptions struct {
	Queries []string
	// contains filtered or unexported fields
}

func (ListExecutionsOptions) New

type ListOption

type ListOption func(*ListOptions)

type ListOptions

type ListOptions struct {
	Queries []string
	Search  string
	// contains filtered or unexported fields
}

func (ListOptions) New

func (options ListOptions) New() *ListOptions

type UpdateOption

type UpdateOption func(*UpdateOptions)

type UpdateOptions

type UpdateOptions struct {
	Runtime               string
	Execute               []string
	Events                []string
	Schedule              string
	Timeout               int
	Enabled               bool
	Logging               bool
	Entrypoint            string
	Commands              string
	Scopes                []string
	InstallationId        string
	ProviderRepositoryId  string
	ProviderBranch        string
	ProviderSilentMode    bool
	ProviderRootDirectory string
	Specification         string
	// contains filtered or unexported fields
}

func (UpdateOptions) New

func (options UpdateOptions) New() *UpdateOptions

type UpdateVariableOption

type UpdateVariableOption func(*UpdateVariableOptions)

type UpdateVariableOptions

type UpdateVariableOptions struct {
	Value  string
	Secret bool
	// contains filtered or unexported fields
}

func (UpdateVariableOptions) New

Jump to

Keyboard shortcuts

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