functions

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 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 CreateBuildOption

type CreateBuildOption func(*CreateBuildOptions)

type CreateBuildOptions

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

func (CreateBuildOptions) New

func (options CreateBuildOptions) New() *CreateBuildOptions

type CreateDeploymentOption

type CreateDeploymentOption func(*CreateDeploymentOptions)

type CreateDeploymentOptions

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

func (CreateDeploymentOptions) New

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
	TemplateRepository    string
	TemplateOwner         string
	TemplateRootDirectory string
	TemplateVersion       string
	Specification         string
	// contains filtered or unexported fields
}

func (CreateOptions) New

func (options CreateOptions) New() *CreateOptions

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) CreateBuild

func (srv *Functions) CreateBuild(FunctionId string, DeploymentId string, optionalSetters ...CreateBuildOption) (*interface{}, error)

CreateBuild

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) 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) CreateVariable

func (srv *Functions) CreateVariable(FunctionId string, Key string, Value string) (*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) 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 code deployment by its unique ID.

func (*Functions) GetDeploymentDownload

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

GetDeploymentDownload get a Deployment's contents by its unique ID. This endpoint supports range requests for partial or streaming file download.

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 project'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) UpdateDeployment

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

UpdateDeployment update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint.

func (*Functions) UpdateDeploymentBuild

func (srv *Functions) UpdateDeploymentBuild(FunctionId string, DeploymentId string) (*models.Build, error)

UpdateDeploymentBuild

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) WithCreateBuildBuildId

func (srv *Functions) WithCreateBuildBuildId(v string) CreateBuildOption

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) 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) WithCreateTemplateOwner

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

func (*Functions) WithCreateTemplateRepository

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

func (*Functions) WithCreateTemplateRootDirectory

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

func (*Functions) WithCreateTemplateVersion

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

func (*Functions) WithCreateTimeout

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

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) WithListExecutionsSearch

func (srv *Functions) WithListExecutionsSearch(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) WithUpdateVariableValue

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

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
	Search  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
	// 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