Documentation ¶
Index ¶
- func CreateFunction(c *gcorecloud.ServiceClient, nsName string, opts CreateFunctionOptsBuilder) (r tasks.Result)
- func CreateNamespace(c *gcorecloud.ServiceClient, opts CreateNamespaceOptsBuilder) (r tasks.Result)
- func DeleteFunction(c *gcorecloud.ServiceClient, nsName, fName string) (r tasks.Result)
- func DeleteKey(c *gcorecloud.ServiceClient, kName string) error
- func DeleteNamespace(c *gcorecloud.ServiceClient, name string) (r tasks.Result)
- func ExtractFunctionsInto(p pagination.Page, v interface{}) error
- func ExtractKeysInto(p pagination.Page, v interface{}) error
- func ExtractNamespacesInto(r pagination.Page, v interface{}) error
- func ListFunctions(c *gcorecloud.ServiceClient, nsName string, opts ListOptsBuilder) pagination.Pager
- func ListKeys(c *gcorecloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- func ListNamespace(c *gcorecloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- func UpdateFunction(c *gcorecloud.ServiceClient, nsName, fName string, ...) (r tasks.Result)
- func UpdateNamespace(c *gcorecloud.ServiceClient, name string, opts UpdateNamespaceOptsBuilder) (r tasks.Result)
- type CreateFunctionOpts
- type CreateFunctionOptsBuilder
- type CreateKeyOpts
- type CreateKeyOptsBuilder
- type CreateNamespaceOpts
- type CreateNamespaceOptsBuilder
- type DeleteResult
- type DeployStatus
- type Function
- type FunctionAutoscaling
- type FunctionPage
- type FunctionResult
- type Key
- func CreateKey(c *gcorecloud.ServiceClient, opts CreateKeyOptsBuilder) (r Key, err error)
- func ExtractKeys(p pagination.Page) ([]Key, error)
- func ListKeysAll(c *gcorecloud.ServiceClient, opts ListOptsBuilder) ([]Key, error)
- func UpdateKey(c *gcorecloud.ServiceClient, kName string, opts UpdateKeyOptsBuilder) (k Key, err error)
- type KeyPage
- type KeyResult
- type KeysFunction
- type ListOpts
- type ListOptsBuilder
- type Namespace
- type NamespacePage
- type NamespaceResult
- type UpdateFunctionOpts
- type UpdateFunctionOptsBuilder
- type UpdateKeyOpts
- type UpdateKeyOptsBuilder
- type UpdateNamespaceOpts
- type UpdateNamespaceOptsBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFunction ¶
func CreateFunction(c *gcorecloud.ServiceClient, nsName string, opts CreateFunctionOptsBuilder) (r tasks.Result)
CreateFunction create FaaS function.
func CreateNamespace ¶
func CreateNamespace(c *gcorecloud.ServiceClient, opts CreateNamespaceOptsBuilder) (r tasks.Result)
CreateNamespace create FaaS namespace.
func DeleteFunction ¶
func DeleteFunction(c *gcorecloud.ServiceClient, nsName, fName string) (r tasks.Result)
DeleteFunction delete FaaS function.
func DeleteKey ¶ added in v0.6.0
func DeleteKey(c *gcorecloud.ServiceClient, kName string) error
DeleteKey delete FaaS key.
func DeleteNamespace ¶
func DeleteNamespace(c *gcorecloud.ServiceClient, name string) (r tasks.Result)
DeleteNamespace delete FaaS namespace.
func ExtractFunctionsInto ¶
func ExtractFunctionsInto(p pagination.Page, v interface{}) error
func ExtractKeysInto ¶ added in v0.6.0
func ExtractKeysInto(p pagination.Page, v interface{}) error
func ExtractNamespacesInto ¶
func ExtractNamespacesInto(r pagination.Page, v interface{}) error
func ListFunctions ¶
func ListFunctions(c *gcorecloud.ServiceClient, nsName string, opts ListOptsBuilder) pagination.Pager
ListFunctions returns a Pager which allows you to iterate over a collection of functions. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.
func ListKeys ¶ added in v0.6.0
func ListKeys(c *gcorecloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
ListKeys returns a Pager which allows you to iterate over a collection of keys. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.
func ListNamespace ¶
func ListNamespace(c *gcorecloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
ListNamespace returns a Pager which allows you to iterate over a collection of namespaces. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.
func UpdateFunction ¶
func UpdateFunction(c *gcorecloud.ServiceClient, nsName, fName string, opts UpdateFunctionOptsBuilder) (r tasks.Result)
UpdateFunction update FaaS function.
func UpdateNamespace ¶
func UpdateNamespace(c *gcorecloud.ServiceClient, name string, opts UpdateNamespaceOptsBuilder) (r tasks.Result)
UpdateNamespace update FaaS namespace.
Types ¶
type CreateFunctionOpts ¶
type CreateFunctionOpts struct { Name string `json:"name"` Description string `json:"description"` Envs map[string]string `json:"envs"` Runtime string `json:"runtime"` Timeout int `json:"timeout"` Flavor string `json:"flavor"` Autoscaling FunctionAutoscaling `json:"autoscaling"` CodeText string `json:"code_text"` EnableApiKey *bool `json:"enable_api_key,omitempty"` Keys []string `json:"keys,omitempty"` Disabled *bool `json:"disabled,omitempty"` MainMethod string `json:"main_method"` Dependencies string `json:"dependencies,omitempty"` }
CreateFunctionOpts represents options used to create a function.
func (CreateFunctionOpts) ToFunctionCreateMap ¶
func (opts CreateFunctionOpts) ToFunctionCreateMap() (map[string]interface{}, error)
ToFunctionCreateMap builds a request body from CreateFunctionOpts.
type CreateFunctionOptsBuilder ¶
CreateFunctionOptsBuilder allows extensions to add additional parameters to the request.
type CreateKeyOpts ¶ added in v0.6.0
type CreateKeyOpts struct { Name string `json:"name"` Description string `json:"description"` Expire *gcorecloud.JSONRFC3339ZZ `json:"expire,omitempty"` Functions []KeysFunction `json:"functions,omitempty"` }
CreateKeyOpts represents options used to create a key.
func (CreateKeyOpts) ToKeyCreateMap ¶ added in v0.6.0
func (opts CreateKeyOpts) ToKeyCreateMap() (map[string]any, error)
type CreateKeyOptsBuilder ¶ added in v0.6.0
CreateKeyOptsBuilder allows extensions to add additional parameters to the request.
type CreateNamespaceOpts ¶
type CreateNamespaceOpts struct { Name string `json:"name" required:"true" validate:"required"` Description string `json:"description"` Envs map[string]string `json:"envs"` }
CreateNamespaceOpts represents options used to create a namespace.
func (CreateNamespaceOpts) ToNamespaceCreateMap ¶
func (opts CreateNamespaceOpts) ToNamespaceCreateMap() (map[string]interface{}, error)
ToNamespaceCreateMap builds a request body from CreateNamespaceOpts.
type CreateNamespaceOptsBuilder ¶
type CreateNamespaceOptsBuilder interface {
ToNamespaceCreateMap() (map[string]interface{}, error)
}
CreateNamespaceOptsBuilder allows extensions to add additional parameters to the request.
type DeleteResult ¶
type DeleteResult struct {
gcorecloud.ErrResult
}
DeleteResult represents the result of a delete operation
type DeployStatus ¶
type Function ¶
type Function struct { Name string `json:"name"` Description string `json:"description"` BuildMessage string `json:"build_message"` BuildStatus string `json:"build_status"` Status string `json:"status"` DeployStatus DeployStatus `json:"deploy_status"` Dependencies string `json:"dependencies"` Envs map[string]string `json:"envs"` Runtime string `json:"runtime"` Timeout int `json:"timeout"` Flavor string `json:"flavor"` Autoscaling FunctionAutoscaling `json:"autoscaling"` CodeText string `json:"code_text"` MainMethod string `json:"main_method"` Endpoint string `json:"endpoint"` Disabled bool `json:"disabled"` EnableAPIKey bool `json:"enable_api_key"` Keys []string `json:"keys"` CreatedAt gcorecloud.JSONRFC3339ZZ `json:"created_at"` }
Function represents FaaS function.
func ExtractFunctions ¶
func ExtractFunctions(p pagination.Page) ([]Function, error)
ExtractFunctions accepts a Page struct, specifically a FunctionPage struct, and extracts the elements into a slice of Function structs. In other words, a generic collection is mapped into a relevant slice.
func ListFunctionsALL ¶
func ListFunctionsALL(c *gcorecloud.ServiceClient, nsName string, opts ListOptsBuilder) ([]Function, error)
ListFunctionsALL returns all functions.
type FunctionAutoscaling ¶
type FunctionPage ¶
type FunctionPage struct {
pagination.LinkedPageBase
}
FunctionPage is the page returned by a pager when traversing over a collection of functions.
func (FunctionPage) IsEmpty ¶
func (f FunctionPage) IsEmpty() (bool, error)
IsEmpty checks whether a Function struct is empty.
func (FunctionPage) NextPageURL ¶
func (f FunctionPage) NextPageURL() (string, error)
NextPageURL is invoked when a paginated collection of functions has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.
type FunctionResult ¶
type FunctionResult struct {
gcorecloud.Result
}
func GetFunction ¶
func GetFunction(c *gcorecloud.ServiceClient, nsName, fName string) (r FunctionResult)
GetFunction get FaaS function.
func (FunctionResult) Extract ¶
func (r FunctionResult) Extract() (*Function, error)
Extract is a function that accepts a result and extracts a FunctionResult resource.
func (FunctionResult) ExtractInto ¶
func (r FunctionResult) ExtractInto(v interface{}) error
type Key ¶ added in v0.6.0
type Key struct { Name string `json:"name"` Description string `json:"description"` Functions []KeysFunction `json:"functions"` Expire gcorecloud.JSONRFC3339ZZ `json:"expire"` CreatedAt gcorecloud.JSONRFC3339ZZ `json:"created_at"` Secret string `json:"secret,omitempty"` Status string `json:"status"` }
func CreateKey ¶ added in v0.6.0
func CreateKey(c *gcorecloud.ServiceClient, opts CreateKeyOptsBuilder) (r Key, err error)
CreateKey create FaaS key.
func ExtractKeys ¶ added in v0.6.0
func ExtractKeys(p pagination.Page) ([]Key, error)
ExtractKeys accepts a Page struct, specifically a KeyPage struct, and extracts the elements into a slice of Key structs. In other words, a generic collection is mapped into a relevant slice.
func ListKeysAll ¶ added in v0.6.0
func ListKeysAll(c *gcorecloud.ServiceClient, opts ListOptsBuilder) ([]Key, error)
ListKeysAll returns all keys.
func UpdateKey ¶ added in v0.6.0
func UpdateKey(c *gcorecloud.ServiceClient, kName string, opts UpdateKeyOptsBuilder) (k Key, err error)
UpdateKey update FaaS key.
type KeyPage ¶ added in v0.6.0
type KeyPage struct {
pagination.LinkedPageBase
}
KeyPage is the page returned by a paper when traversing over a collection of keys
func (KeyPage) NextPageURL ¶ added in v0.6.0
NextPageURL is invoked when a pagination collection of keys has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.
type KeyResult ¶ added in v0.6.0
type KeyResult struct {
gcorecloud.Result
}
func GetKey ¶ added in v0.6.0
func GetKey(c *gcorecloud.ServiceClient, kName string) (r KeyResult)
GetKey get FaaS key.
func (KeyResult) ExtractInto ¶ added in v0.6.0
type KeysFunction ¶ added in v0.6.0
type ListOpts ¶
type ListOpts struct { Limit int `q:"limit"` Offset int `q:"offset"` Search string `q:"search"` OrderBy string `q:"order_by"` }
ListOpts allows the filtering and sorting of paginated collections through the API.
func (ListOpts) ToFaaSListQuery ¶
ToFaaSListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the Versions request.
type Namespace ¶
type Namespace struct { Name string `json:"name"` Description string `json:"description"` Status string `json:"status"` Envs map[string]string `json:"envs"` Functions []Function `json:"functions"` FunctionsDeployStatus DeployStatus `json:"functions_deploy_status"` CreatedAt gcorecloud.JSONRFC3339ZZ `json:"created_at"` }
Namespace represents FaaS namespace.
func ExtractNamespaces ¶
func ExtractNamespaces(r pagination.Page) ([]Namespace, error)
ExtractNamespaces accepts a Page struct, specifically a NamespacePage struct, and extracts the elements into a slice of Namespace structs. In other words, a generic collection is mapped into a relevant slice.
func ListNamespaceALL ¶
func ListNamespaceALL(c *gcorecloud.ServiceClient, opts ListOptsBuilder) ([]Namespace, error)
ListNamespaceALL returns all namespaces.
type NamespacePage ¶
type NamespacePage struct {
pagination.LinkedPageBase
}
NamespacePage is the page returned by a pager when traversing over a collection of namespace.
func (NamespacePage) IsEmpty ¶
func (r NamespacePage) IsEmpty() (bool, error)
IsEmpty checks whether a Namespace struct is empty.
func (NamespacePage) NextPageURL ¶
func (r NamespacePage) NextPageURL() (string, error)
NextPageURL is invoked when a paginated collection of namespaces has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.
type NamespaceResult ¶
type NamespaceResult struct {
gcorecloud.Result
}
func GetNamespace ¶
func GetNamespace(c *gcorecloud.ServiceClient, name string) (r NamespaceResult)
GetNamespace retrieves a specific namespace based on its name.
func (NamespaceResult) Extract ¶
func (r NamespaceResult) Extract() (*Namespace, error)
Extract is a function that accepts a result and extracts a NamespaceResult resource.
func (NamespaceResult) ExtractInto ¶
func (r NamespaceResult) ExtractInto(v interface{}) error
type UpdateFunctionOpts ¶
type UpdateFunctionOpts struct { Description string `json:"description,omitempty"` Envs map[string]string `json:"envs,omitempty"` Timeout int `json:"timeout,omitempty"` Flavor string `json:"flavor,omitempty"` Autoscaling *FunctionAutoscaling `json:"autoscaling,omitempty"` CodeText string `json:"code_text,omitempty"` EnableApiKey *bool `json:"enable_api_key,omitempty"` Keys *[]string `json:"keys,omitempty"` Disabled *bool `json:"disabled,omitempty"` Dependencies string `json:"dependencies,omitempty"` MainMethod string `json:"main_method,omitempty"` }
UpdateFunctionOpts represents options used to Update a function.
func (UpdateFunctionOpts) ToFunctionUpdateMap ¶
func (opts UpdateFunctionOpts) ToFunctionUpdateMap() (map[string]interface{}, error)
ToFunctionUpdateMap builds a request body from UpdateFunctionOpts.
type UpdateFunctionOptsBuilder ¶
UpdateFunctionOptsBuilder allows extensions to add additional parameters to the request.
type UpdateKeyOpts ¶ added in v0.6.0
type UpdateKeyOpts struct { Description string `json:"description,omitempty"` Expire *gcorecloud.JSONRFC3339ZZ `json:"expire,omitempty"` Functions []KeysFunction `json:"functions,omitempty"` }
UpdateKeyOpts represents options used to Update a key.
func (UpdateKeyOpts) ToKeyUpdateMap ¶ added in v0.6.0
func (opts UpdateKeyOpts) ToKeyUpdateMap() (map[string]interface{}, error)
ToKeyUpdateMap builds a request body from UpdateKeyOpts.
type UpdateKeyOptsBuilder ¶ added in v0.6.0
UpdateKeyOptsBuilder allows extensions to add additional parameters to the request.
type UpdateNamespaceOpts ¶
type UpdateNamespaceOpts struct { Description string `json:"description,omitempty"` Envs map[string]string `json:"envs,omitempty"` }
UpdateNamespaceOpts represents options used to update a namespace.
func (UpdateNamespaceOpts) ToNamespaceUpdateMap ¶
func (opts UpdateNamespaceOpts) ToNamespaceUpdateMap() (map[string]interface{}, error)
ToNamespaceUpdateMap builds a request body from UpdateNamespaceOpts.
type UpdateNamespaceOptsBuilder ¶
type UpdateNamespaceOptsBuilder interface {
ToNamespaceUpdateMap() (map[string]interface{}, error)
}
UpdateNamespaceOptsBuilder allows extensions to add additional parameters to the request.