rename function -> func (#217)

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
This commit is contained in:
Zbynek Roubalik 2020-11-06 12:47:30 +01:00 committed by GitHub
parent cd57692c9d
commit 470ebb9da4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 117 additions and 117 deletions

View File

@ -1 +1 @@
/function
/func

View File

@ -29,21 +29,21 @@ jobs:
- name: Lint
run: make check
- name: Permissions
run: chmod a+x function_*amd*
run: chmod a+x func_*amd*
# Upload all build artifacts whether it's a release or not
- uses: actions/upload-artifact@v2
with:
name: OSX Binary
path: function_darwin_amd64
path: func_darwin_amd64
- uses: actions/upload-artifact@v2
with:
name: Linux Binary
path: function_linux_amd64
path: func_linux_amd64
- uses: actions/upload-artifact@v2
with:
name: Windows Binary
path: function_windows_amd64.exe
path: func_windows_amd64.exe
# Build and push a latest image with each commit
- name: Image
@ -59,7 +59,7 @@ jobs:
# The following steps are only executed if this is a release
- name: Compress Binaries
if: ${{ steps.release.outputs.release_created }}
run: gzip function_darwin_amd64 function_linux_amd64 function_windows_amd64.exe
run: gzip func_darwin_amd64 func_linux_amd64 func_windows_amd64.exe
# Upload all binaries
- name: Upload Darwin Binary
@ -69,8 +69,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: ./function_darwin_amd64.gz
asset_name: function_darwin_amd64.gz
asset_path: ./func_darwin_amd64.gz
asset_name: func_darwin_amd64.gz
asset_content_type: application/x-gzip
- name: Upload Linux Binary
uses: actions/upload-release-asset@v1
@ -79,8 +79,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: ./functionlinux_amd64.gz
asset_name: function_linux_amd64.gz
asset_path: ./func_linux_amd64.gz
asset_name: func_linux_amd64.gz
asset_content_type: application/x-gzip
- name: Upload Windows Binary
uses: actions/upload-release-asset@v1
@ -89,6 +89,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: ./function_windows_amd64.exe.gz
asset_name: function_windows_amd64.exe.gz
asset_path: ./func_windows_amd64.exe.gz
asset_name: func_windows_amd64.exe.gz
asset_content_type: application/x-gzip

4
.gitignore vendored
View File

@ -1,5 +1,5 @@
/function
/function_*
/func
/func_*
/templates/go/events/go.sum
/templates/go/http/go.sum
/coverage.out

View File

@ -6,5 +6,5 @@ RUN make
FROM alpine:latest
RUN apk add --no-cache ca-certificates
COPY --from=build /src/function /bin/
ENTRYPOINT ["function"]
COPY --from=build /src/func /bin/
ENTRYPOINT ["func"]

View File

@ -1,5 +1,5 @@
REPO := quay.io/boson/function
BIN := function
REPO := quay.io/boson/func
BIN := func
DARWIN=$(BIN)_darwin_amd64
LINUX=$(BIN)_linux_amd64

View File

@ -9,7 +9,7 @@
[Demo Screencast]
`function` is a Client Library and CLI for enabling the development of implicitly deployed, platform agnostic code.
`func` is a Client Library and CLI for enabling the development of implicitly deployed, platform agnostic code.
[Read the Documentation](docs/README.md)

View File

@ -161,9 +161,9 @@ func TestDefaultTrigger(t *testing.T) {
// using a custom path to a template repository on disk. Custom repository
// location is not defined herein but expected to be provided because, for
// example, a CLI may want to use XDG_CONFIG_HOME. Assuming a repository path
// $FUNCTIONTEMPLATES, a Go template named 'json' which is provided in the
// $FUNC_TEMPLATES, a Go template named 'json' which is provided in the
// repository 'boson-experimental', would be expected to be in the location:
// $FUNCTION_TEMPLATES/boson-experimental/go/json
// $FUNC_TEMPLATES/boson-experimental/go/json
// See the CLI for full details, but a standard default location is
// $HOME/.config/templates/boson-experimental/go/json
func TestExtensibleTemplates(t *testing.T) {

View File

@ -14,10 +14,10 @@ import (
func init() {
root.AddCommand(buildCmd)
buildCmd.Flags().StringP("builder", "b", "default", "Buildpacks builder")
buildCmd.Flags().BoolP("confirm", "c", false, "Prompt to confirm all configuration options - $FUNCTION_CONFIRM")
buildCmd.Flags().StringP("image", "i", "", "Optional full image name, in form [registry]/[namespace]/[name]:[tag] for example quay.io/myrepo/project.name:latest (overrides --registry) - $FUNCTION_IMAGE")
buildCmd.Flags().StringP("path", "p", cwd(), "Path to the Function project directory - $FUNCTION_PATH")
buildCmd.Flags().StringP("registry", "r", "", "Registry for built images, ex 'docker.io/myuser' or just 'myuser'. Optional if --image provided. - $FUNCTION_REGISTRY")
buildCmd.Flags().BoolP("confirm", "c", false, "Prompt to confirm all configuration options - $FUNC_CONFIRM")
buildCmd.Flags().StringP("image", "i", "", "Optional full image name, in form [registry]/[namespace]/[name]:[tag] for example quay.io/myrepo/project.name:latest (overrides --registry) - $FUNC_IMAGE")
buildCmd.Flags().StringP("path", "p", cwd(), "Path to the Function project directory - $FUNC_PATH")
buildCmd.Flags().StringP("registry", "r", "", "Registry for built images, ex 'docker.io/myuser' or just 'myuser'. Optional if --image provided. - $FUNC_REGISTRY")
err := buildCmd.RegisterFlagCompletionFunc("builder", CompleteBuilderList)
if err != nil {

View File

@ -18,14 +18,14 @@ var completionCmd = &cobra.Command{
Long: `To load completion run
For zsh:
source <(function completion zsh)
source <(func completion zsh)
If you would like to use alias:
alias f=function
compdef _function f
alias f=func
compdef _func f
For bash:
source <(function completion bash)
source <(func completion bash)
`,
ValidArgs: []string{"bash", "zsh", "fish"},

View File

@ -13,10 +13,10 @@ import (
func init() {
root.AddCommand(createCmd)
createCmd.Flags().BoolP("confirm", "c", false, "Prompt to confirm all configuration options - $FFUNCTION_CONFIRM")
createCmd.Flags().StringP("runtime", "l", faas.DefaultRuntime, "Function runtime language/framework. Default runtime is 'node'. Available runtimes: 'node', 'quarkus' and 'go'. - $FUNCTION_RUNTIME")
createCmd.Flags().StringP("templates", "", filepath.Join(configPath(), "templates"), "Extensible templates path. - $FUNCTION_TEMPLATES")
createCmd.Flags().StringP("trigger", "t", faas.DefaultTrigger, "Function trigger. Default trigger is 'http'. Available triggers: 'http' and 'events' - $FUNCTION_TRIGGER")
createCmd.Flags().BoolP("confirm", "c", false, "Prompt to confirm all configuration options - $FUNC_CONFIRM")
createCmd.Flags().StringP("runtime", "l", faas.DefaultRuntime, "Function runtime language/framework. Default runtime is 'node'. Available runtimes: 'node', 'quarkus' and 'go'. - $FUNC_RUNTIME")
createCmd.Flags().StringP("templates", "", filepath.Join(configPath(), "templates"), "Extensible templates path. - $FUNC_TEMPLATES")
createCmd.Flags().StringP("trigger", "t", faas.DefaultTrigger, "Function trigger. Default trigger is 'http'. Available triggers: 'http' and 'events' - $FUNC_TRIGGER")
if err := createCmd.RegisterFlagCompletionFunc("runtime", CompleteRuntimeList); err != nil {
fmt.Println("Error while calling RegisterFlagCompletionFunc: ", err)

View File

@ -13,8 +13,8 @@ import (
func init() {
root.AddCommand(deleteCmd)
deleteCmd.Flags().BoolP("confirm", "c", false, "Prompt to confirm all configuration options - $FUNCTION_CONFIRM")
deleteCmd.Flags().StringP("path", "p", cwd(), "Path to the project which should be deleted - $FUNCTION_PATH")
deleteCmd.Flags().BoolP("confirm", "c", false, "Prompt to confirm all configuration options - $FUNC_CONFIRM")
deleteCmd.Flags().StringP("path", "p", cwd(), "Path to the project which should be deleted - $FUNC_PATH")
deleteCmd.Flags().StringP("namespace", "n", "", "Override namespace in which to search for Functions. Default is to use currently active underlying platform setting - $FAAS_NAMESPACE")
}

View File

@ -15,12 +15,12 @@ import (
func init() {
root.AddCommand(deployCmd)
deployCmd.Flags().BoolP("confirm", "c", false, "Prompt to confirm all configuration options - $FUNCTION_CONFIRM")
deployCmd.Flags().BoolP("confirm", "c", false, "Prompt to confirm all configuration options - $FUNC_CONFIRM")
deployCmd.Flags().StringArrayP("env", "e", []string{}, "Sets environment variables for the Function.")
deployCmd.Flags().StringP("image", "i", "", "Optional full image name, in form [registry]/[namespace]/[name]:[tag] for example quay.io/myrepo/project.name:latest (overrides --registry) - $FUNCTION_IMAGE")
deployCmd.Flags().StringP("namespace", "n", "", "Override namespace into which the Function is deployed (on supported platforms). Default is to use currently active underlying platform setting - $FUNCTION_NAMESPACE")
deployCmd.Flags().StringP("path", "p", cwd(), "Path to the function project directory - $FUNCTION_PATH")
deployCmd.Flags().StringP("registry", "r", "", "Image registry for built images, ex 'docker.io/myuser' or just 'myuser'. - $FUNCTION_REGISTRY")
deployCmd.Flags().StringP("image", "i", "", "Optional full image name, in form [registry]/[namespace]/[name]:[tag] for example quay.io/myrepo/project.name:latest (overrides --registry) - $FUNC_IMAGE")
deployCmd.Flags().StringP("namespace", "n", "", "Override namespace into which the Function is deployed (on supported platforms). Default is to use currently active underlying platform setting - $FUNC_NAMESPACE")
deployCmd.Flags().StringP("path", "p", cwd(), "Path to the function project directory - $FUNC_PATH")
deployCmd.Flags().StringP("registry", "r", "", "Image registry for built images, ex 'docker.io/myuser' or just 'myuser'. - $FUNC_REGISTRY")
}
var deployCmd = &cobra.Command{

View File

@ -17,9 +17,9 @@ import (
func init() {
root.AddCommand(describeCmd)
describeCmd.Flags().StringP("namespace", "n", "", "Override namespace in which to search for the Function. Default is to use currently active underlying platform setting - $FUNCTION_NAMESPACE")
describeCmd.Flags().StringP("format", "f", "human", "optionally specify output format (human|plain|json|xml|yaml) $FUNCTION_FORMAT")
describeCmd.Flags().StringP("path", "p", cwd(), "Path to the project which should be described - $FUNCTION_PATH")
describeCmd.Flags().StringP("namespace", "n", "", "Override namespace in which to search for the Function. Default is to use currently active underlying platform setting - $FUNC_NAMESPACE")
describeCmd.Flags().StringP("format", "f", "human", "optionally specify output format (human|plain|json|xml|yaml) $FUNC_FORMAT")
describeCmd.Flags().StringP("path", "p", cwd(), "Path to the project which should be described - $FUNC_PATH")
err := describeCmd.RegisterFlagCompletionFunc("format", CompleteOutputFormatList)
if err != nil {

View File

@ -18,8 +18,8 @@ import (
func init() {
root.AddCommand(listCmd)
listCmd.Flags().StringP("namespace", "n", "", "Override namespace in which to search for Functions. Default is to use currently active underlying platform setting - $FUNCTION_NAMESPACE")
listCmd.Flags().StringP("format", "f", "human", "optionally specify output format (human|plain|json|xml|yaml) $FUNCTION_FORMAT")
listCmd.Flags().StringP("namespace", "n", "", "Override namespace in which to search for Functions. Default is to use currently active underlying platform setting - $FUNC_NAMESPACE")
listCmd.Flags().StringP("format", "f", "human", "optionally specify output format (human|plain|json|xml|yaml) $FUNC_FORMAT")
err := listCmd.RegisterFlagCompletionFunc("format", CompleteOutputFormatList)
if err != nil {

View File

@ -17,7 +17,7 @@ import (
// available flags, etc. It has no action of its own, such that running the
// resultant binary with no arguments prints the help/usage text.
var root = &cobra.Command{
Use: "function",
Use: "func",
Short: "Manage function projects",
SilenceErrors: true, // we explicitly handle errors in Execute()
SilenceUsage: true, // no usage dump on error
@ -53,8 +53,8 @@ func init() {
// version subcommand: nothing but the version.
root.SetVersionTemplate(`{{printf "%s\n" .Version}}`)
// Prefix all environment variables with "FUNCTION_" to avoid collisions with other apps.
viper.SetEnvPrefix("function")
// Prefix all environment variables with "FUNC_" to avoid collisions with other apps.
viper.SetEnvPrefix("func")
}
// Execute the command tree by executing the root command, which runs
@ -97,15 +97,15 @@ func cwd() (cwd string) {
// function defaults and extensible templates.
func configPath() (path string) {
if path = os.Getenv("XDG_CONFIG_HOME"); path != "" {
path = filepath.Join(path, "function")
path = filepath.Join(path, "func")
return
}
home, err := homedir.Expand("~")
if err != nil {
fmt.Fprintf(os.Stderr, "could not derive home directory for use as default templates path: %v", err)
path = filepath.Join(".config", "function")
path = filepath.Join(".config", "func")
} else {
path = filepath.Join(home, ".config", "function")
path = filepath.Join(home, ".config", "func")
}
return
}
@ -217,7 +217,7 @@ func deriveNameAndAbsolutePathFromPath(path string) (string, string) {
// will be prepended.
//
// If the image flag is provided, this value is used directly (the user supplied
// --image or $FUNCTION_IMAGE). Otherwise, the Function at 'path' is loaded, and
// --image or $FUNC_IMAGE). Otherwise, the Function at 'path' is loaded, and
// the Image name therein is used (i.e. it was previously calculated).
// Finally, the default registry is used, which is prepended to the Function
// name, and appended with ':latest':

View File

@ -14,7 +14,7 @@ func init() {
// Add the run command as a subcommand of root.
root.AddCommand(runCmd)
runCmd.Flags().StringArrayP("env", "e", []string{}, "Sets environment variables for the Function.")
runCmd.Flags().StringP("path", "p", cwd(), "Path to the Function project directory - $FUNCTION_PATH")
runCmd.Flags().StringP("path", "p", cwd(), "Path to the Function project directory - $FUNC_PATH")
}
var runCmd = &cobra.Command{

View File

@ -2,7 +2,7 @@
[Demo Screencast]
`function` is a Client Library and CLI for enabling the development of implicitly deployed, platform agnostic code.
`func` is a Client Library and CLI for enabling the development of implicitly deployed, platform agnostic code.
For examples of what's possible, see the [Screencast Series](getting_started_screencast.md) or the [Functions Cookbook](functions_cookbook.md).

View File

@ -7,13 +7,13 @@ Creates a new Function project at _`path`_. If _`path`_ is unspecified, assumes
Similar `kn` command: none.
```console
function create <path> [-l <runtime> -t <trigger>]
func create <path> [-l <runtime> -t <trigger>]
```
When run as a `kn` plugin.
```console
kn function create <path> [-l <runtime> -t <trigger>]
kn func create <path> [-l <runtime> -t <trigger>]
```
## `build`
@ -25,84 +25,84 @@ The value(s) provided for image and registry are persisted to the `func.yaml` fi
Similar `kn` command: none.
```console
function build [-i <image> -r <registry> -p <path>]
func build [-i <image> -r <registry> -p <path>]
```
When run as a `kn` plugin.
```console
kn function build [-i <image> -r <registry> -p <path>]
kn func build [-i <image> -r <registry> -p <path>]
```
## `run`
Runs the Function project locally in the container. If a container has not yet been created, prompts the user to run `function build`. The user may specify a path to the project directory using the `--path` or `-p` flag.
Runs the Function project locally in the container. If a container has not yet been created, prompts the user to run `func build`. The user may specify a path to the project directory using the `--path` or `-p` flag.
Similar `kn` command: none.
```console
function run
func run
```
When run as a `kn` plugin.
```console
kn function run [-p <path>]
kn func run [-p <path>]
```
## `deploy`
Builds and deploys the Function project in the current directory. The user may specify a path to the project directory using the `--path` or `-p` flag. Reads the `func.yaml` configuration file to determine the image name. An image and registry may be specified on the command line using the `--image` or `-i` and `--registry` or `-r` flag.
Derives the service name from the project name. There is no mechanism by which the user can specify the service name. The user must have already initialized the function using `function create` or they will encounter an error.
Derives the service name from the project name. There is no mechanism by which the user can specify the service name. The user must have already initialized the function using `func create` or they will encounter an error.
If the Function is already deployed, it is updated with a new container image that is pushed to a
container image registry, and the Knative Service is updated.
The namespace into which the project is deployed defaults to the value in the `func.yaml` configuration file. If `NAMESPACE` is not set in the configuration, the namespace currently active in the Kubernetes configuration file will be used. The namespace may be specified on the command line using the `--namespace` or `-n` flag, and if so this will overwrite the value in the `func.yaml` file.
Similar `kn` command: `kn service create NAME --image IMAGE [flags]`. This command allows a user to deploy a Knative Service by specifying an image, typically one hosted on a public container registry such as docker.io. The deployment options which the `kn` command affords the user are quite broad. The `kn` command in this case is quite effective for a power user. The `function deploy` command has a similar end result, but is definitely easier for a user just getting started to be successful with.
Similar `kn` command: `kn service create NAME --image IMAGE [flags]`. This command allows a user to deploy a Knative Service by specifying an image, typically one hosted on a public container registry such as docker.io. The deployment options which the `kn` command affords the user are quite broad. The `kn` command in this case is quite effective for a power user. The `func deploy` command has a similar end result, but is definitely easier for a user just getting started to be successful with.
```console
function deploy [-n <namespace> -p <path> -i <image> -r <registry>]
func deploy [-n <namespace> -p <path> -i <image> -r <registry>]
```
When run as a `kn` plugin.
```console
kn function deploy [-n <namespace> -p <path> -i <image> -r <registry>]
kn func deploy [-n <namespace> -p <path> -i <image> -r <registry>]
```
## `describe`
Prints the name, route and any event subscriptions for a deployed Function. The user may also specify the name of the function to describe. The namespace defaults to the value in `func.yaml` or the namespace currently active in the user's Kubernetes configuration. The namespace may be specified on the command line, and if so this will overwrite the value in `func.yaml`.
Similar `kn` command: `kn service describe NAME [flags]`. This flag provides a lot of nice information not available in `function describe`, such as revisions, age, annotations and labels. This command should be renamed to make it distinct from `kn` - e.g. `function status`.
Similar `kn` command: `kn service describe NAME [flags]`. This flag provides a lot of nice information not available in `func describe`, such as revisions, age, annotations and labels. This command should be renamed to make it distinct from `kn` - e.g. `func status`.
```console
function describe [-f <format> -n <namespace> -p <path>]
func describe [-f <format> -n <namespace> -p <path>]
```
When run as a `kn` plugin.
```console
kn function describe [-f <format> -n <namespace> -p <path>]
kn func describe [-f <format> -n <namespace> -p <path>]
```
## `list`
Lists all deployed functions. The namespace defaults to the value in `func.yaml` or the namespace currently active in the user's Kubernetes configuration. The namespace defaults to the value in `func.yaml` or the namespace currently active in the user's Kubernetes configuration. The namespace may be specified on the command line, and if so this will overwrite the value in `func.yaml`.
Similar `kn` command: `kn service list [name] [flags]`. This command lists all deployed Knative `Services`. As with other `kn` commands that have similar functionality, there is more information and flexibilty in the `kn` command. However, `kn` will return _all_ `Services`, while `function list` will only display the boson Functions that have been deployed. Consider improving the output of the `function list` command so that it is at least as informative as `kn service list`.
Similar `kn` command: `kn service list [name] [flags]`. This command lists all deployed Knative `Services`. As with other `kn` commands that have similar functionality, there is more information and flexibilty in the `kn` command. However, `kn` will return _all_ `Services`, while `func list` will only display the boson functions that have been deployed. Consider improving the output of the `func list` command so that it is at least as informative as `kn service list`.
```console
function list [-n <namespace> -p <path>]
func list [-n <namespace> -p <path>]
```
When run as a `kn` plugin.
```console
kn function list [-n <namespace> -p <path>]
kn func list [-n <namespace> -p <path>]
```
## `delete`
@ -112,11 +112,11 @@ Removes a deployed function from the cluster. The user may specify a function by
Similar `kn` command: `kn service delete NAME [flags]`.
```console
function delete <name> [-n namespace, -p path]
func delete <name> [-n namespace, -p path]
```
When run as a `kn` plugin.
```console
kn function delete <name> [-n namespace, -p path]
kn func delete <name> [-n namespace, -p path]
```

View File

@ -10,8 +10,8 @@ of a new function.
It is recommended to set your preferred image registry for publishing Functions
by setting the following environment variables:
```
export FUNCTION_REGISTRY=quay.io
export FUNCTION_NAMESPACE=alice
export FUNC_REGISTRY=quay.io
export FUNC_NAMESPACE=alice
```
Alternately, when using the CLI these values can be provided using the --namespace and --registry
flags.
@ -23,7 +23,7 @@ flags.
```shell
> mkdir -p example.com/www
> cd example.com/www
> function create go
> func create go
https://www.example.com
> curl https://www.example.com
OK

View File

@ -18,11 +18,11 @@ Once access to a kubernetes-compatible cluster has been established, it will nee
Create a namespace for your Functions:
```
kubectl create namespace function
kubectl create namespace func
```
Set the default namespace for subsequent commands:
```
kubectl config set-context --current --namespace=function
kubectl config set-context --current --namespace=func
```
### Serving
@ -39,7 +39,7 @@ Update the networking layer to
- Use Kourier
- use TLS
- Redirect HTTP requests to HTTPS
- Add function subdomain annotations
- Add func subdomain annotations
```
kubectl apply -f knative/config-network.yaml
```
@ -109,7 +109,7 @@ kubectl edit configmap config-certmanager --namespace knative-serving
### Eventing
Eventing with In-memory channels, a Channel broker, and enable the default broker in the function namespace.
Eventing with In-memory channels, a Channel broker, and enable the default broker in the func namespace.
```
kubectl apply --filename https://github.com/knative/eventing/releases/download/v0.16.0/eventing-crds.yaml
kubectl apply --filename https://github.com/knative/eventing/releases/download/v0.16.0/eventing-core.yaml
@ -122,9 +122,9 @@ kubectl apply --filename https://github.com/knative/eventing-contrib/releases/do
```
Learn more about the GitHub source at https://knative.dev/docs/eventing/samples/github-source/index.html
Enable Broker for function namespace:
Enable Broker for func namespace:
```
kubectl label namespace function knative-eventing-injection=enabled
kubectl label namespace func knative-eventing-injection=enabled
```
### Monitoring

View File

@ -6,11 +6,11 @@ The CLI can be used to invoke most features of the function system. One can cho
The latest release can be run as a container:
```
docker run quay.io/boson/function
docker run quay.io/boson/func
```
To run a specific version of the CLI, use the version desired as the image tag:
```
docker run quay.io/boson/function:v0.9.0
docker run quay.io/boson/func:v0.9.0
```
### Prebuilt Binary
@ -25,6 +25,6 @@ Each version is built and made available as a prebuilt binary. See [All Release
To build and install from source check out the repository, run `make`, and install the resultant binary:
```
make
mv function /usr/local/bin/
mv func /usr/local/bin/
```

View File

@ -1,6 +1,6 @@
# Integrator's Guide
Developer's can integrate directly with the Function system using the client library upon which the `function` CLI is based. Before beginning this section, you should have a configured provider and be familiar with the topics covered in the [developer's guide](docs/developers_guide.md).
Developer's can integrate directly with the Function system using the client library upon which the `func` CLI is based. Before beginning this section, you should have a configured provider and be familiar with the topics covered in the [developer's guide](docs/developers_guide.md).
## Using the Client Library

View File

@ -9,9 +9,9 @@ data:
# one entry per TLD+1. Example:
boson-project.com: |
selector:
function.domain: "boson-project.com"
func.domain: "boson-project.com"
boson-project.org: |
selector:
function.domain: "boson-project.org"
func.domain: "boson-project.org"
# Default is local only.
svc.cluster.local: ""

View File

@ -10,11 +10,11 @@ data:
autoTLS: Enabled
# Redirect HTTP requests to HTTPS
httpProtocol: Redirected
# If there exists an annotation `function.subdomain` on the service,
# If there exists an annotation `func.subdomain` on the service,
# use it instead of the default name.namespace
domainTemplate: |-
{{if index .Annotations "function.subdomain" -}}
{{- index .Annotations "function.subdomain" -}}
{{if index .Annotations "func.subdomain" -}}
{{- index .Annotations "func.subdomain" -}}
{{else -}}
{{- .Name}}.{{.Namespace -}}
{{end -}}

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@ func init() {
type faasPlugin struct {}
func (f *faasPlugin) Name() string {
return "kn-function"
return "kn-func"
}
func (f *faasPlugin) Execute(args []string) error {
@ -22,7 +22,7 @@ func (f *faasPlugin) Execute(args []string) error {
defer (func() {
os.Args = oldArgs
})()
os.Args = append([]string { "kn-function" }, args...)
os.Args = append([]string { "kn-func" }, args...)
return rootCmd.Execute()
}
@ -32,7 +32,7 @@ func (f *faasPlugin) Description() (string, error) {
}
func (f *faasPlugin) CommandParts() []string {
return []string{ "function"}
return []string{ "func"}
}
// Path is empty because its an internal plugins

View File

@ -82,7 +82,7 @@ func copyFilesystem(templatesPath, runtime, templateFullName, dest string) error
template := cc[1]
// Example FileSystem path:
// /home/alice/.config/function/templates/boson-experimental/go/json
// /home/alice/.config/func/templates/boson-experimental/go/json
src := filepath.Join(templatesPath, repo, runtime, template)
return copy(src, dest, filesystemAccessor{})
}

View File

@ -6,7 +6,7 @@ Welcome to your new Go Function! The boilerplate function code can be found in [
Develop new features by adding a test to [`handle_test.go`](handle_test.go) for each feature, and confirm it works with `go test`.
Update the running analog of the funciton using the `function` CLI or client library, and it can be invoked using a manually-created CloudEvent:
Update the running analog of the funciton using the `func` CLI or client library, and it can be invoked using a manually-created CloudEvent:
```console
curl -X POST -d '{"hello": "world"}' \

View File

@ -8,7 +8,7 @@ Welcome to your new Go Function! The boilerplate function code can be found in
Develop new features by adding a test to [`handle_test.go`](handle_test.go) for
each feature, and confirm it works with `go test`.
Update the running analog of the function using the `function` CLI or client
Update the running analog of the function using the `func` CLI or client
library, and it can be invoked from your browser or from the command line:
```console

View File

@ -15,14 +15,14 @@ so debugger can be attached if needed.
To run test locally run `./mvnw test`.
## The `function` CLI
## The `func` CLI
It's recommended to set `FUNCTION_REGISTRY` environment variable.
It's recommended to set `FUNC_REGISTRY` environment variable.
```shell script
# replace ~/.bashrc by your shell rc file
# replace docker.io/johndoe with your registry
export FUNCTION_REGISTRY=docker.io/johndoe
echo "export FUNCTION_REGISTRY=docker.io/johndoe" >> ~/.bashrc
export FUNC_REGISTRY=docker.io/johndoe
echo "export FUNC_REGISTRY=docker.io/johndoe" >> ~/.bashrc
```
### Building
@ -30,8 +30,8 @@ echo "export FUNCTION_REGISTRY=docker.io/johndoe" >> ~/.bashrc
This command builds OCI image for the function.
```shell script
function build # build jar
function build --builder native # build native binary
func build # build jar
func build --builder native # build native binary
```
### Running
@ -39,7 +39,7 @@ function build --builder native # build native binary
This command runs the function locally in a container
using the image created above.
```shell script
function run
func run
```
### Deploying
@ -47,7 +47,7 @@ function run
This commands will build and deploy the function into cluster.
```shell script
function deploy # also triggers build
func deploy # also triggers build
```
## Function invocation
@ -56,7 +56,7 @@ Do not forget to set `URL` variable to the route of your function.
You get the route by following command.
```shell script
function describe
func describe
```
### cURL

View File

@ -15,14 +15,14 @@ so debugger can be attached if needed.
To run test locally run `./mvnw test`.
## The `function` CLI
## The `func` CLI
It's recommended to set `FUNCTION_REGISTRY` environment variable.
It's recommended to set `FUNC_REGISTRY` environment variable.
```shell script
# replace ~/.bashrc by your shell rc file
# replace docker.io/johndoe with your registry
export FUNCTION_REGISTRY=docker.io/johndoe
echo "export FUNCTION_REGISTRY=docker.io/johndoe" >> ~/.bashrc
export FUNC_REGISTRY=docker.io/johndoe
echo "export FUNC_REGISTRY=docker.io/johndoe" >> ~/.bashrc
```
### Building
@ -30,16 +30,16 @@ echo "export FUNCTION_REGISTRY=docker.io/johndoe" >> ~/.bashrc
This command builds OCI image for the function.
```shell script
function build # build jar
function build --builder native # build native binary
func build # build jar
func build --builder native # build native binary
```
### Running
This command runs the function locally in a container
This command runs the func locally in a container
using the image created above.
```shell script
function run
func run
```
### Deploying
@ -47,7 +47,7 @@ function run
This commands will build and deploy the function into cluster.
```shell script
function deploy # also triggers build
func deploy # also triggers build
```
## Function invocation
@ -56,7 +56,7 @@ Do not forget to set `URL` variable to the route of your function.
You get the route by following command.
```shell script
function describe
func describe
```
### cURL