diff --git a/.github/workflows/dead-link-checker.yaml b/.github/workflows/dead-link-checker.yaml index 081f11b245..48be809aca 100644 --- a/.github/workflows/dead-link-checker.yaml +++ b/.github/workflows/dead-link-checker.yaml @@ -1,9 +1,9 @@ name: Layotto Env Pipeline 🌊 +# Deadlink Validation will auto run at 0:00 am everyday. on: - pull_request: - branches: - - main + schedule: + - cron: '0 0 * * *' jobs: check: @@ -23,4 +23,4 @@ jobs: nohup docsify serve docs -p 3000 & - name: Check dead links in all the .md files - run: make style.deadlink + run: make deadlink diff --git a/.github/workflows/layotto-ci.yml b/.github/workflows/layotto-ci.yml index 616a0519ab..0411007ae2 100644 --- a/.github/workflows/layotto-ci.yml +++ b/.github/workflows/layotto-ci.yml @@ -30,7 +30,7 @@ jobs: go-version: 1.18.1 - name: Format Go run: | - make check.style + make workspace resolve-modules: name: "🌈️ Resolve Go Modules" runs-on: ubuntu-latest @@ -71,7 +71,7 @@ jobs: with: go-version: 1.18.1 - name: Go Unit Test - run: make check.unit + run: make test coverage: name: "🤔 Coverage Analysis" @@ -81,7 +81,7 @@ jobs: - name: Check out code uses: actions/checkout@v2 - name: Test Coverage - run: make style.coverage + run: make coverage - name: Post Coverage run: bash <(curl -s https://codecov.io/bash) @@ -97,7 +97,7 @@ jobs: - name: Check out code uses: actions/checkout@v2 - name: Run Integrate tests - run: make integrate.wasm + run: make integrate-wasm runtime-integrate: name: "⚙️ Integrate with Runtime" @@ -111,7 +111,7 @@ jobs: - name: Check out code uses: actions/checkout@v2 - name: Run Integrate tests - run: make integrate.runtime + run: make integrate-runtime build-binary-darwin-amd64-artifact: name: "🧳 Darwin AMD64 Artifact" diff --git a/.github/workflows/layotto-release.yml b/.github/workflows/layotto-release.yml index 7e4a3eff82..836ef65b34 100644 --- a/.github/workflows/layotto-release.yml +++ b/.github/workflows/layotto-release.yml @@ -17,7 +17,7 @@ jobs: go-version: 1.18.1 - name: Format Go run: | - make check.style + make workspace resolve-modules: name: "👀 Resolve Go Modules" @@ -60,7 +60,7 @@ jobs: with: go-version: 1.18.1 - name: Go Unit Test - run: make check.unit + run: make test coverage: name: "🤔 Coverage Analysis" @@ -70,7 +70,7 @@ jobs: - name: Check out code uses: actions/checkout@v2 - name: Test Coverage - run: make style.coverage + run: make coverage - name: Post Coverage run: bash <(curl -s https://codecov.io/bash) @@ -86,7 +86,7 @@ jobs: - name: Check out code uses: actions/checkout@v2 - name: Run Integrate tests - run: make integrate.wasm + run: make integrate-wasm runtime-integrate: name: "⚙️ Integrate with Runtime" @@ -100,7 +100,7 @@ jobs: - name: Check out code uses: actions/checkout@v2 - name: Run Integrate tests - run: make integrate.runtime + run: make integrate-runtime build-binary-darwin-amd64-artifact: name: "🧳 Darwin AMD64 Artifact" diff --git a/.github/workflows/quickstart-checker.yml b/.github/workflows/quickstart-checker.yml index fd9eae77e6..af1d83e034 100644 --- a/.github/workflows/quickstart-checker.yml +++ b/.github/workflows/quickstart-checker.yml @@ -42,7 +42,7 @@ jobs: fi - name: Test quickstart in Golang 1.14.13 - run: make style.quickstart + run: make quickstart - name: Set up Go 1.x uses: actions/setup-go@v2 @@ -50,4 +50,4 @@ jobs: go-version: 1.17.8 - name: Test quickstart in Golang 1.17.8 - run: make style.quickstart QUICKSTART_VERSION=1.17 + run: make quickstart QUICKSTART_VERSION=1.17 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 1ac40b6c81..c64e8ecb5e 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,4 +1,5 @@ name: Layotto Env Pipeline 🌊 + on: schedule: - cron: '30 1 * * *' diff --git a/Makefile b/Makefile index d8b980204d..d1a044d991 100644 --- a/Makefile +++ b/Makefile @@ -11,337 +11,23 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Layotto commands 👀: - -# A fast and efficient cloud native application runtime 🚀. -# Commands below are used in Development 💻 and GitHub workflow 🌊. - -# Usage: make ... - -# COMMANDS: -# build Build layotto for host platform. -# build.multiarch Build layotto for multiple platforms. See option PLATFORMS. -# image Build docker images for host arch. -# image.multiarch Build docker images for multiple platforms. See option PLATFORMS. -# push Push docker images to registry. -# push.multiarch Push docker images for multiple platforms to registry. -# app Build app docker images for host arch. [`/docker/app` contains apps dockerfiles] -# app.multiarch Build app docker images for multiple platforms. See option PLATFORMS. -# wasm Build layotto wasm for linux arm64 platform. -# wasm.multiarch Build layotto wasm for multiple platform. -# wasm.image Build layotto wasm image for multiple platform. -# wasm.image.push Push layotto wasm image for multiple platform. -# check Run all go checks of code sources. -# check.lint Run go syntax and styling of go sources. -# check.unit Run go unit test. -# check.style Run go style test. -# style.coverage Run coverage analysis. -# style.deadlink Run deadlink check test. -# style.quickstart Run quickstart check test. -# integrate.wasm Run integration test with wasm. -# integrate.runtime Run integration test with runtime. -# format Format layotto go codes style with gofmt and goimports. -# clean Remove all files that are created by building. -# all Run format codes, check codes, build Layotto codes for host platform with one command -# help Show this help info. - -# ARGS: -# BINS The binaries to build. Default is all of cmd. -# This option is available when using: make build/build.multiarch -# Example: make build BINS="layotto_multiple_api layotto" -# IMAGES Backend images to make. Default is all of cmds. -# This option is available when using: make image/image.multiarch/push/push.multiarch -# Example: make image.multiarch IMAGES="layotto_multiple_api layotto" -# PLATFORMS The multiple platforms to build. Default is linux_amd64 and linux_arm64. -# This option is available when using: make build.multiarch/image.multiarch/push.multiarch -# Example: make image.multiarch IMAGES="layotto" PLATFORMS="linux_amd64 linux_arm64" -# Supported Platforms: linux_amd64 linux_arm64 darwin_amd64 darwin_arm64 - - -SHELL := /bin/bash - -# ============================================================================== -# ROOT Options: -# ============================================================================== - -ROOT_PACKAGE=mosn.io/layotto - -# ============================================================================== -# Includes: -# ============================================================================== - -include make/common.mk -include make/golang.mk -include make/image.mk -include make/wasm.mk -include make/ci.mk -include make/deploy.mk -include make/proto.mk - -# ============================================================================== -# Targets: -# ============================================================================== - -# ============================================================================== -## build: Build layotto for host platform. -# ============================================================================== -.PHONY: build -build: - @$(MAKE) go.build - -# ============================================================================== -## build.multiarch: Build layotto for multiple platforms. See option PLATFORMS. -# ============================================================================== -.PHONY: build.multiarch -build.multiarch: - @$(MAKE) go.build.multiarch - -# ============================================================================== -## image: Build docker images for host arch. -# ============================================================================== -.PHONY: image -image: - @$(MAKE) image.build - -# ============================================================================== -## image.multiarch: Build docker images for multiple platforms. See option PLATFORMS. -# ============================================================================== -.PHONY: image.multiarch -image.multiarch: - @$(MAKE) image.build.multiarch - -# ============================================================================== -## push: Push docker images to registry. -# ============================================================================== -.PHONY: push -push: - @$(MAKE) image.push - -# ============================================================================== -## push.multiarch: Push docker images for multiple platforms to registry. -# ============================================================================== -.PHONY: push.multiarch -push.multiarch: - @$(MAKE) image.push.multiarch - -# ============================================================================== -## app: Build app docker images for host arch. [`/docker/app` contains apps dockerfiles] -# ============================================================================== -.PHONY: app -app: - @$(MAKE) app.image - -# ============================================================================== -## app.multiarch: Build app docker images for multiple platforms. See option PLATFORMS. -# ============================================================================== -.PHONY: app.multiarch -app.multiarch: - @$(MAKE) app.image.multiarch - -# ============================================================================== -## wasm: Build layotto wasm for linux arm64 platform. -# ============================================================================== -.PHONY: wasm -wasm: - @$(MAKE) go.wasm - -# ============================================================================== -## wasm.multiarch: Build layotto wasm for multiple platform. -# ============================================================================== -.PHONY: wasm.multiarch -wasm.multiarch: - @$(MAKE) go.wasm.multiarch - -# ============================================================================== -## wasm.image: Build layotto wasm image for multiple platform. -# ============================================================================== -.PHONY: wasm.image -wasm.image: - @$(MAKE) go.wasm.image - -# ============================================================================== -## wasm.image.push: Push layotto wasm image for multiple platform. -# ============================================================================== -.PHONY: wasm.image.push -wasm.image.push: - @$(MAKE) go.wasm.image.push - -# ============================================================================== -## deploy: Deploy Layotto to Kubernetes -# ============================================================================== -.PHONY: deploy -deploy: - @$(MAKE) deploy.k8s - -# ============================================================================== -## deploy.standalone: Deploy Layotto to Kubernetes in Standalone Mode -# ============================================================================== -.PHONY: deploy.standalone -deploy.standalone: - @$(MAKE) deploy.k8s.standalone - -# ============================================================================== -## undeploy: Remove Layotto in Kubernetes -# ============================================================================== -.PHONY: undeploy -undeploy: - @$(MAKE) undeploy.k8s - -# ============================================================================== -## undeploy.standalone: Remove Layotto in Kubernetes in Standalone Mode -# ============================================================================== -.PHONY: undeploy.standalone -undeploy.standalone: - @$(MAKE) undeploy.k8s.standalone - -# ============================================================================== -## check: Run all go checks of code sources. -# ============================================================================== -.PHONY: check -check: check.style check.unit check.lint - -# ============================================================================== -## check.lint: Run go syntax and styling of go sources. -# ============================================================================== -.PHONY: check.lint -check.lint: - @$(MAKE) go.lint - -# ============================================================================== -## check.unit: Run go unit test. -# ============================================================================== -.PHONY: check.unit -check.unit: - @$(MAKE) go.test - -# ============================================================================== -## check.style: Run go style test. -# ============================================================================== -.PHONY: check.style -check.style: - @$(MAKE) go.style - -# ============================================================================== -## style.coverage: Run coverage analysis. -# ============================================================================== -.PHONY: style.coverage -style.coverage: - @$(MAKE) checker.coverage - -# ============================================================================== -## style.deadlink: Run deadlink check test. -# ============================================================================== -.PHONY: style.deadlink -style.deadlink: - @$(MAKE) checker.deadlink - -# ============================================================================== -## style.quickstart: Run quickstart check test. -# ============================================================================== -.PHONY: style.quickstart -style.quickstart: - @$(MAKE) checker.quickstart - -# ============================================================================== -## license: Add license headers for code files. -# ============================================================================== -.PHONY: license -license: - @$(MAKE) checker.license.fix - -# ============================================================================== -## integrate.wasm: Run integration test with wasm. -# ============================================================================== -.PHONY: integrate.wasm -integrate.wasm: - @$(MAKE) integration.wasm - -# ============================================================================== -## integrate.runtime: Run integration test with runtime. -# ============================================================================== -.PHONY: integrate.runtime -integrate.runtime: - @$(MAKE) integration.runtime - -# ============================================================================== -## format: Format layotto go codes style with gofmt and goimports. -# ============================================================================== -.PHONY: format -format: go.format - -# ============================================================================== -## clean: Remove all files that are created by building. -# ============================================================================== -.PHONY: clean -clean: - @$(MAKE) go.clean - -# ============================================================================== -## proto.doc: Generate documentation according to the proto files. -# ============================================================================== -.PHONY: proto.doc -proto.doc: - @$(MAKE) proto.gen.doc - -# ============================================================================== -## proto: Generate code and documentation based on the proto files. -# ============================================================================== -.PHONY: proto -proto: - @$(MAKE) proto.gen.all - -# ============================================================================== -## proto.init: Install protoc-gen-go and protoc-gen-go-grpc -# ============================================================================== -.PHONY: proto.init -proto.init: - @$(MAKE) proto.gen.init - -# ============================================================================== -## proto.code: Generate pb.go code according to the proto files. -# ============================================================================== -.PHONY: proto.code -proto.code: - @$(MAKE) proto.gen.code - -# ============================================================================== -## all: Run format codes, check codes, build Layotto codes for host platform with one command -# ============================================================================== -.PHONY: all -all: clean format check style.quickstart clean - -# ============================================================================== -# Usage -# ============================================================================== - -define USAGE_OPTIONS - -ARGS: - BINS The binaries to build. Default is all of cmd. - This option is available when using: make build/build.multiarch - Example: make build BINS="layotto_multiple_api layotto" - IMAGES Backend images to make. Default is all of cmds. - This option is available when using: make image/image.multiarch/push/push.multiarch - Example: make image.multiarch IMAGES="layotto_multiple_api layotto" - PLATFORMS The multiple platforms to build. Default is linux_amd64 and linux_arm64. - This option is available when using: make build.multiarch/image.multiarch/push.multiarch - Example: make image.multiarch IMAGES="layotto" PLATFORMS="linux_amd64 linux_arm64" - Supported Platforms: linux_amd64 linux_arm64 darwin_amd64 darwin_arm64 - NAMESPACE The namepace to deploy. Default is `default`. - This option is available when using: make deploy/deploy.standalone/undeploy/undeploy.standalone - Example: make deploy NAMESPACE="layotto" -endef -export USAGE_OPTIONS - -# ============================================================================== -# Help -# ============================================================================== - -## help: Show this help info. -.PHONY: help -help: Makefile - @echo -e "Layotto commands 👀: \n\nA fast and efficient cloud native application runtime 🚀." - @echo -e "Commands below are used in Development 💻 and GitHub workflow 🌊.\n" - @echo -e "Usage: make ...\n\nCOMMANDS:" - @sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /' - @echo "$$USAGE_OPTIONS" \ No newline at end of file +# All make targets should be implemented in make/*.mk +# ==================================================================================================== +# Supported Targets: (Run `make help` to see more information) +# ==================================================================================================== + +# This file is a wrapper around `make` so that we can force on the +# --warn-undefined-variables flag. Sure, you can set +# `MAKEFLAGS += --warn-undefined-variables` from inside of a Makefile, +# but then it won't turn on until the second phase (recipe execution), +# and won't actually be on during the initial phase (parsing). +# See: https://www.gnu.org/software/make/manual/make.html#Reading-Makefiles + +# Have everything-else ("%") depend on _run (which uses +# $(MAKECMDGOALS) to decide what to run), rather than having +# everything else run $(MAKE) directly, since that'd end up running +# multiple sub-Makes if you give multiple targets on the CLI. +_run: + @$(MAKE) --warn-undefined-variables -f make/common.mk $(MAKECMDGOALS) +.PHONY: _run +$(if $(MAKECMDGOALS),$(MAKECMDGOALS): %: _run) \ No newline at end of file diff --git a/codecov.yml b/codecov.yml index 0547c6c5c6..8be7b85a27 100644 --- a/codecov.yml +++ b/codecov.yml @@ -29,3 +29,4 @@ ignore: - "components/rpc/invoker/mosn/channel/xchannel.go" - "diagnostics/**/*" - "components/pkg/mock/**/*" + - "**/*_generated.go" diff --git a/components/email/interface_generated.go b/components/email/interface_generated.go new file mode 100644 index 0000000000..4c3faaeaa7 --- /dev/null +++ b/components/email/interface_generated.go @@ -0,0 +1,28 @@ +// Code generated by github.com/seeflood/protoc-gen-p6 . + +// Copyright 2021 Layotto Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package email + +import ( + context "context" +) + +type EmailService interface { + Init(context.Context, *Config) error + + SendEmail(context.Context, *SendEmailRequest) (*SendEmailResponse, error) + + SendEmailWithTemplate(context.Context, *SendEmailWithTemplateRequest) (*SendEmailWithTemplateResponse, error) +} diff --git a/components/email/struct_generated.go b/components/email/struct_generated.go new file mode 100644 index 0000000000..b61101c8f6 --- /dev/null +++ b/components/email/struct_generated.go @@ -0,0 +1,82 @@ +// Code generated by github.com/seeflood/protoc-gen-p6 . + +// Copyright 2021 Layotto Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package email + +// SendEmailWithTemplateRequest is the message send to email. +type SendEmailWithTemplateRequest struct { + // The saas service name, like 'aliyun.email'/'aws.ses'/'...' + // If your system uses multiple IVR services at the same time, + // you can specify which service to use with this field. + ComponentName string `json:"component_name,omitempty"` + // Required. + Template *EmailTemplate `json:"template,omitempty"` + // Required. The Email subject. + Subject string `json:"subject,omitempty"` + // Required. + Address *EmailAddress `json:"address,omitempty"` +} + +// Address information +type EmailAddress struct { + // Required. The Email sender address. + From string `json:"from,omitempty"` + // Required. The Email destination addresses. + To []string `json:"to,omitempty"` + // Optional. To whom the mail is cc + Cc []string `json:"cc,omitempty"` +} + +// Email template +type EmailTemplate struct { + // Required + TemplateId string `json:"template_id,omitempty"` + // Required + TemplateParams map[string]string `json:"template_params,omitempty"` +} + +// Response of `SendEmailWithTemplate` method +type SendEmailWithTemplateResponse struct { + // The saas requestId. + RequestId string `json:"request_id,omitempty"` +} + +// SendEmailRequest is the message send to email. +type SendEmailRequest struct { + // The saas service name, like 'aliyun.email'/'aws.ses'/'...' + // If your system uses multiple IVR services at the same time, + // you can specify which service to use with this field. + ComponentName string `json:"component_name,omitempty"` + // Required. + SettingId string `json:"setting_id,omitempty"` + // Required. The Email subject. + Subject string `json:"subject,omitempty"` + // Required. + Content *Content `json:"content,omitempty"` + // Required. + Address *EmailAddress `json:"address,omitempty"` +} + +// Email content +type Content struct { + // Required. + Text string `json:"text,omitempty"` +} + +// The response of `SendEmail` method +type SendEmailResponse struct { + // The saas requestId. + RequestId string `json:"request_id,omitempty"` +} diff --git a/components/email/types_generated.go b/components/email/types_generated.go new file mode 100644 index 0000000000..5e4224d7bd --- /dev/null +++ b/components/email/types_generated.go @@ -0,0 +1,79 @@ +// Code generated by github.com/seeflood/protoc-gen-p6 . + +// Copyright 2021 Layotto Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package email + +import ( + fmt "fmt" + + info "mosn.io/layotto/components/pkg/info" + ref "mosn.io/layotto/components/ref" +) + +const ( + serviceName = "email" +) + +// Config is the component's configuration +type Config struct { + ref.Config + Type string `json:"type"` + Metadata map[string]string `json:"metadata"` +} + +type Registry interface { + Register(fs ...*Factory) + Create(compType string) (EmailService, error) +} + +type Factory struct { + CompType string + FactoryMethod func() EmailService +} + +func NewFactory(compType string, f func() EmailService) *Factory { + return &Factory{ + CompType: compType, + FactoryMethod: f, + } +} + +type registry struct { + stores map[string]func() EmailService + info *info.RuntimeInfo +} + +func NewRegistry(info *info.RuntimeInfo) Registry { + info.AddService(serviceName) + return ®istry{ + stores: make(map[string]func() EmailService), + info: info, + } +} + +func (r *registry) Register(fs ...*Factory) { + for _, f := range fs { + r.stores[f.CompType] = f.FactoryMethod + r.info.RegisterComponent(serviceName, f.CompType) + } +} + +func (r *registry) Create(compType string) (EmailService, error) { + if f, ok := r.stores[compType]; ok { + r.info.LoadComponent(serviceName, compType) + return f(), nil + } + return nil, fmt.Errorf("service component %s is not registered", compType) +} diff --git a/components/phone/interface_generated.go b/components/phone/interface_generated.go new file mode 100644 index 0000000000..4f2c0f5cf3 --- /dev/null +++ b/components/phone/interface_generated.go @@ -0,0 +1,26 @@ +// Code generated by github.com/seeflood/protoc-gen-p6 . + +// Copyright 2021 Layotto Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package phone + +import ( + context "context" +) + +type PhoneCallService interface { + Init(context.Context, *Config) error + + SendVoiceWithTemplate(context.Context, *SendVoiceWithTemplateRequest) (*SendVoiceWithTemplateResponse, error) +} diff --git a/components/phone/struct_generated.go b/components/phone/struct_generated.go new file mode 100644 index 0000000000..18e240ec76 --- /dev/null +++ b/components/phone/struct_generated.go @@ -0,0 +1,43 @@ +// Code generated by github.com/seeflood/protoc-gen-p6 . + +// Copyright 2021 Layotto Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package phone + +// The request of SendVoiceWithTemplate method +type SendVoiceWithTemplateRequest struct { + // If your system uses multiple IVR services at the same time, + // you can specify which service to use with this field. + ComponentName string `json:"component_name,omitempty"` + // Required + Template *VoiceTemplate `json:"template,omitempty"` + // Required + ToMobile []string `json:"to_mobile,omitempty"` + // This field is required by some cloud providers. + FromMobile string `json:"from_mobile,omitempty"` +} + +// VoiceTemplate +type VoiceTemplate struct { + // Required + TemplateId string `json:"template_id,omitempty"` + // Required + TemplateParams map[string]string `json:"template_params,omitempty"` +} + +// The response of `SendVoiceWithTemplate` method +type SendVoiceWithTemplateResponse struct { + // Id of this request. + RequestId string `json:"request_id,omitempty"` +} diff --git a/components/phone/types_generated.go b/components/phone/types_generated.go new file mode 100644 index 0000000000..f868e53dab --- /dev/null +++ b/components/phone/types_generated.go @@ -0,0 +1,79 @@ +// Code generated by github.com/seeflood/protoc-gen-p6 . + +// Copyright 2021 Layotto Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package phone + +import ( + fmt "fmt" + + info "mosn.io/layotto/components/pkg/info" + ref "mosn.io/layotto/components/ref" +) + +const ( + serviceName = "phone" +) + +// Config is the component's configuration +type Config struct { + ref.Config + Type string `json:"type"` + Metadata map[string]string `json:"metadata"` +} + +type Registry interface { + Register(fs ...*Factory) + Create(compType string) (PhoneCallService, error) +} + +type Factory struct { + CompType string + FactoryMethod func() PhoneCallService +} + +func NewFactory(compType string, f func() PhoneCallService) *Factory { + return &Factory{ + CompType: compType, + FactoryMethod: f, + } +} + +type registry struct { + stores map[string]func() PhoneCallService + info *info.RuntimeInfo +} + +func NewRegistry(info *info.RuntimeInfo) Registry { + info.AddService(serviceName) + return ®istry{ + stores: make(map[string]func() PhoneCallService), + info: info, + } +} + +func (r *registry) Register(fs ...*Factory) { + for _, f := range fs { + r.stores[f.CompType] = f.FactoryMethod + r.info.RegisterComponent(serviceName, f.CompType) + } +} + +func (r *registry) Create(compType string) (PhoneCallService, error) { + if f, ok := r.stores[compType]; ok { + r.info.LoadComponent(serviceName, compType) + return f(), nil + } + return nil, fmt.Errorf("service component %s is not registered", compType) +} diff --git a/components/rpc/invoker/mosn/mosninvoker.go b/components/rpc/invoker/mosn/mosninvoker.go index 7ef453b148..c85dc4e330 100644 --- a/components/rpc/invoker/mosn/mosninvoker.go +++ b/components/rpc/invoker/mosn/mosninvoker.go @@ -96,7 +96,7 @@ func (m *mosnInvoker) Invoke(ctx context.Context, req *rpc.RPCRequest) (resp *rp if req.Timeout == 0 { req.Timeout = rpc.DefaultRequestTimeoutMs if ts, ok := req.Header[rpc.RequestTimeoutMs]; ok && len(ts) > 0 { - t, err := strconv.Atoi(ts[0]) + t, err := strconv.ParseInt(ts[0], 10, 32) if err == nil && t != 0 { req.Timeout = int32(t) } diff --git a/configs/config.json b/configs/config.json index 0f2ba607e2..8fa353a654 100644 --- a/configs/config.json +++ b/configs/config.json @@ -22,7 +22,7 @@ "server_name": "runtime", "grpc_config": { "hellos": { - "quick_start_demo": { + "helloworld": { "type": "helloworld", "hello": "greeting" } diff --git a/configs/config_apollo.json b/configs/config_apollo.json index cc9b358877..89e03a61f2 100644 --- a/configs/config_apollo.json +++ b/configs/config_apollo.json @@ -29,7 +29,7 @@ "server_name": "runtime", "grpc_config": { "hellos": { - "quick_start_demo": { + "helloworld": { "type": "helloworld", "hello": "greeting" } diff --git a/configs/config_consul.json b/configs/config_consul.json index 673fc04514..3d62f7f794 100644 --- a/configs/config_consul.json +++ b/configs/config_consul.json @@ -22,7 +22,7 @@ "server_name": "runtime", "grpc_config": { "hellos": { - "quick_start_demo": { + "helloworld": { "type": "helloworld", "hello": "greeting" } diff --git a/configs/config_file.json b/configs/config_file.json index 8cf2cb13eb..6f1cbb9e2e 100644 --- a/configs/config_file.json +++ b/configs/config_file.json @@ -17,7 +17,7 @@ "server_name": "runtime", "grpc_config": { "hellos": { - "quick_start_demo": { + "helloworld": { "type": "helloworld", "hello": "greeting" } diff --git a/configs/config_file_qiniu_oss.json b/configs/config_file_qiniu_oss.json index 4e1d7ea38e..0cd2439cdc 100644 --- a/configs/config_file_qiniu_oss.json +++ b/configs/config_file_qiniu_oss.json @@ -17,7 +17,7 @@ "server_name": "runtime", "grpc_config": { "hellos": { - "quick_start_demo": { + "helloworld": { "type": "helloworld", "hello": "greeting" } diff --git a/configs/config_file_tencentcloud_oss.json b/configs/config_file_tencentcloud_oss.json index c57c8dafae..c825255697 100644 --- a/configs/config_file_tencentcloud_oss.json +++ b/configs/config_file_tencentcloud_oss.json @@ -17,7 +17,7 @@ "server_name": "runtime", "grpc_config": { "hellos": { - "quick_start_demo": { + "helloworld": { "type": "helloworld", "hello": "greeting" } diff --git a/configs/config_mongo.json b/configs/config_mongo.json index 2cc0e621bd..366f749bdf 100644 --- a/configs/config_mongo.json +++ b/configs/config_mongo.json @@ -22,7 +22,7 @@ "server_name": "runtime", "grpc_config": { "hellos": { - "quick_start_demo": { + "helloworld": { "type": "helloworld", "hello": "greeting" } diff --git a/configs/config_redis.json b/configs/config_redis.json index c4db395101..7dc6736920 100644 --- a/configs/config_redis.json +++ b/configs/config_redis.json @@ -22,7 +22,7 @@ "server_name": "runtime", "grpc_config": { "hellos": { - "quick_start_demo": { + "helloworld": { "type": "helloworld", "hello": "greeting" } diff --git a/configs/config_standalone.json b/configs/config_standalone.json index 5e83dd51d6..2ec7ca4a66 100644 --- a/configs/config_standalone.json +++ b/configs/config_standalone.json @@ -22,7 +22,7 @@ "server_name": "runtime", "grpc_config": { "hellos": { - "quick_start_demo": { + "helloworld": { "type": "helloworld", "hello": "greeting" } diff --git a/configs/config_trace_jaeger.json b/configs/config_trace_jaeger.json index a79492890f..5ee7b2471d 100644 --- a/configs/config_trace_jaeger.json +++ b/configs/config_trace_jaeger.json @@ -17,7 +17,7 @@ "server_name": "runtime", "grpc_config": { "hellos": { - "quick_start_demo": { + "helloworld": { "type": "helloworld", "hello": "greeting" } diff --git a/configs/config_trace_skywalking.json b/configs/config_trace_skywalking.json index e72c875bed..10b4873bab 100644 --- a/configs/config_trace_skywalking.json +++ b/configs/config_trace_skywalking.json @@ -17,7 +17,7 @@ "server_name": "runtime", "grpc_config": { "hellos": { - "quick_start_demo": { + "helloworld": { "type": "helloworld", "hello": "greeting" } diff --git a/configs/config_trace_zipkin.json b/configs/config_trace_zipkin.json index 46362df280..bbb2a467de 100644 --- a/configs/config_trace_zipkin.json +++ b/configs/config_trace_zipkin.json @@ -17,7 +17,7 @@ "server_name": "runtime", "grpc_config": { "hellos": { - "quick_start_demo": { + "helloworld": { "type": "helloworld", "hello": "greeting" } diff --git a/configs/config_zookeeper.json b/configs/config_zookeeper.json index 2829a8b6a9..3a3c2e7eed 100644 --- a/configs/config_zookeeper.json +++ b/configs/config_zookeeper.json @@ -22,7 +22,7 @@ "server_name": "runtime", "grpc_config": { "hellos": { - "quick_start_demo": { + "helloworld": { "type": "helloworld", "hello": "greeting" } diff --git a/configs/runtime_config.json b/configs/runtime_config.json index 2d72c76289..bc47750e2b 100644 --- a/configs/runtime_config.json +++ b/configs/runtime_config.json @@ -17,7 +17,7 @@ "server_name": "runtime", "grpc_config": { "hellos": { - "quick_start_demo": { + "helloworld": { "type": "helloworld", "hello": "greeting" } diff --git a/demo/flowcontrol/client.go b/demo/flowcontrol/client.go index 870abc07ca..3cf7253fe2 100644 --- a/demo/flowcontrol/client.go +++ b/demo/flowcontrol/client.go @@ -36,7 +36,7 @@ func main() { for i := 0; i < 10; i++ { r, err := c.SayHello(context.Background(), &runtimev1pb.SayHelloRequest{ - ServiceName: "quick_start_demo", + ServiceName: "helloworld", }) if err != nil { fmt.Println("get an error: ", err) diff --git a/demo/lifecycle/common/client.go b/demo/lifecycle/common/client.go index 004e5de1a3..05b107923c 100644 --- a/demo/lifecycle/common/client.go +++ b/demo/lifecycle/common/client.go @@ -17,7 +17,7 @@ func main() { // 1. invoke sayHello API client := runtimev1pb.NewRuntimeClient(conn) hello, err := client.SayHello(context.Background(), &runtimev1pb.SayHelloRequest{ - ServiceName: "quick_start_demo", + ServiceName: "helloworld", Name: "eva", }) if err != nil { @@ -36,7 +36,7 @@ func main() { metaData["hello"] = "goodbye" req := &runtimev1pb.DynamicConfiguration{ComponentConfig: &runtimev1pb.ComponentConfig{ Kind: "hellos", - Name: "quick_start_demo", + Name: "helloworld", Metadata: metaData, }} _, err = c.ApplyConfiguration(context.Background(), req) @@ -46,7 +46,7 @@ func main() { // 3. invoke sayHello API again client = runtimev1pb.NewRuntimeClient(conn) hello, err = client.SayHello(context.Background(), &runtimev1pb.SayHelloRequest{ - ServiceName: "quick_start_demo", + ServiceName: "helloworld", Name: "eva", }) if err != nil { diff --git a/deploy/k8s/sidecar/default_quickstart_counter.yaml b/deploy/k8s/sidecar/default_quickstart_counter.yaml index 45dea2bcee..4e57acb155 100644 --- a/deploy/k8s/sidecar/default_quickstart_counter.yaml +++ b/deploy/k8s/sidecar/default_quickstart_counter.yaml @@ -28,7 +28,7 @@ data: "server_name": "runtime", "grpc_config": { "hellos": { - "quick_start_demo": { + "helloworld": { "type": "helloworld", "hello": "greeting" } diff --git a/deploy/k8s/standalone/default_configmap.yaml b/deploy/k8s/standalone/default_configmap.yaml index 20fb1587fc..a0a6c4b108 100644 --- a/deploy/k8s/standalone/default_configmap.yaml +++ b/deploy/k8s/standalone/default_configmap.yaml @@ -28,7 +28,7 @@ data: "server_name": "runtime", "grpc_config": { "hellos": { - "quick_start_demo": { + "helloworld": { "type": "helloworld", "hello": "greeting" } diff --git a/deploy/k8s/standalone/default_quickstart.yaml b/deploy/k8s/standalone/default_quickstart.yaml index 58cda42893..4179b6e6a3 100644 --- a/deploy/k8s/standalone/default_quickstart.yaml +++ b/deploy/k8s/standalone/default_quickstart.yaml @@ -28,7 +28,7 @@ data: "server_name": "runtime", "grpc_config": { "hellos": { - "quick_start_demo": { + "helloworld": { "type": "helloworld", "hello": "greeting" } diff --git a/docker/layotto-etcd/etcd_config.json b/docker/layotto-etcd/etcd_config.json index 864913680d..1a23beba51 100644 --- a/docker/layotto-etcd/etcd_config.json +++ b/docker/layotto-etcd/etcd_config.json @@ -17,7 +17,7 @@ "server_name": "runtime", "grpc_config": { "hellos": { - "quick_start_demo": { + "helloworld": { "type": "helloworld", "hello": "greeting" } diff --git a/docker/layotto-minio/config_minio.json b/docker/layotto-minio/config_minio.json index 33dae046b2..8042e6e137 100644 --- a/docker/layotto-minio/config_minio.json +++ b/docker/layotto-minio/config_minio.json @@ -17,7 +17,7 @@ "server_name": "runtime", "grpc_config": { "hellos": { - "quick_start_demo": { + "helloworld": { "type": "helloworld", "hello": "greeting" } diff --git a/docker/layotto-redis/config_redis.json b/docker/layotto-redis/config_redis.json index 6e82c5a93a..894b5dba54 100644 --- a/docker/layotto-redis/config_redis.json +++ b/docker/layotto-redis/config_redis.json @@ -22,7 +22,7 @@ "server_name": "runtime", "grpc_config": { "hellos": { - "quick_start_demo": { + "helloworld": { "type": "helloworld", "hello": "greeting" } diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 53a61cbc57..e4846536d9 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -16,6 +16,8 @@ - [Use OSS API](en/start/oss/start.md) - [API plugin: register your own API](en/start/api_plugin/helloworld.md) + - [(Under construction) Use phone API](en/start/phone/start) + - [(Under construction) Use email API](en/start/email/start) - [Use lifecycle API](en/start/lifecycle/start) - As the data plane of istio - [Integrate with istio 1.10.6](en/start/istio/) diff --git a/docs/api/v1/email.html b/docs/api/v1/email.html new file mode 100644 index 0000000000..15a47be189 --- /dev/null +++ b/docs/api/v1/email.html @@ -0,0 +1,735 @@ + + + + + Protocol Documentation + + + + + + + + + + +

Protocol Documentation

+ +

Table of Contents

+ +
+ +
+ + + +
+

email.proto

Top +
+

+ + +

[gRPC Service] EmailService

+

EmailService is used to send emails.

+ + + + + + + + + + + + + + + + + + + + + +
Method NameRequest TypeResponse TypeDescription
SendEmailWithTemplateSendEmailWithTemplateRequestSendEmailWithTemplateResponse

Send an email with template

SendEmailSendEmailRequestSendEmailResponse

Send an email with raw content instead of using templates.

+ + + + +

Content

+

Email content

+ + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
textstring

Required.

+ + + + + +

EmailAddress

+

Address information

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
fromstring

Required. The Email sender address.

tostringrepeated

Required. The Email destination addresses.

ccstringrepeated

Optional. To whom the mail is cc

+ + + + + +

EmailTemplate

+

Email template

+ + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
template_idstring

Required

template_paramsEmailTemplate.TemplateParamsEntryrepeated

Required

+ + + + + +

EmailTemplate.TemplateParamsEntry

+

+ + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
keystring

valuestring

+ + + + + +

SendEmailRequest

+

SendEmailRequest is the message send to email.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
component_namestring

The saas service name, like 'aliyun.email'/'aws.ses'/'...' + If your system uses multiple IVR services at the same time, + you can specify which service to use with this field.

setting_idstring

Required.

subjectstring

Required. The Email subject.

contentContent

Required.

addressEmailAddress

Required.

+ + + + + +

SendEmailResponse

+

The response of `SendEmail` method

+ + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
request_idstring

The saas requestId.

+ + + + + +

SendEmailWithTemplateRequest

+

SendEmailWithTemplateRequest is the message send to email.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
component_namestring

The saas service name, like 'aliyun.email'/'aws.ses'/'...' + If your system uses multiple IVR services at the same time, + you can specify which service to use with this field.

templateEmailTemplate

Required.

subjectstring

Required. The Email subject.

addressEmailAddress

Required.

+ + + + + +

SendEmailWithTemplateResponse

+

Response of `SendEmailWithTemplate` method

+ + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
request_idstring

The saas requestId.

+ + + + + + + + + + + + +

Scalar Value Types

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
.proto TypeNotesC++JavaPythonGoC#PHPRuby
doubledoubledoublefloatfloat64doublefloatFloat
floatfloatfloatfloatfloat32floatfloatFloat
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intintint32intintegerBignum or Fixnum (as required)
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/longint64longinteger/stringBignum
uint32Uses variable-length encoding.uint32intint/longuint32uintintegerBignum or Fixnum (as required)
uint64Uses variable-length encoding.uint64longint/longuint64ulonginteger/stringBignum or Fixnum (as required)
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intintint32intintegerBignum or Fixnum (as required)
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/longint64longinteger/stringBignum
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28.uint32intintuint32uintintegerBignum or Fixnum (as required)
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56.uint64longint/longuint64ulonginteger/stringBignum
sfixed32Always four bytes.int32intintint32intintegerBignum or Fixnum (as required)
sfixed64Always eight bytes.int64longint/longint64longinteger/stringBignum
boolboolbooleanbooleanboolboolbooleanTrueClass/FalseClass
stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicodestringstringstringString (UTF-8)
bytesMay contain any arbitrary sequence of bytes.stringByteStringstr[]byteByteStringstringString (ASCII-8BIT)
+ + diff --git a/docs/api/v1/phone.html b/docs/api/v1/phone.html new file mode 100644 index 0000000000..60d0ae05d4 --- /dev/null +++ b/docs/api/v1/phone.html @@ -0,0 +1,571 @@ + + + + + Protocol Documentation + + + + + + + + + + +

Protocol Documentation

+ +

Table of Contents

+ +
+ +
+ + + +
+

phone.proto

Top +
+

+ + +

[gRPC Service] PhoneCallService

+

PhoneCallService is one of Notify APIs. It's used to send voice messages

+ + + + + + + + + + + + + + +
Method NameRequest TypeResponse TypeDescription
SendVoiceWithTemplateSendVoiceWithTemplateRequestSendVoiceWithTemplateResponse

Send voice using the specific template

+ + + + +

SendVoiceWithTemplateRequest

+

The request of SendVoiceWithTemplate method

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
component_namestring

If your system uses multiple IVR services at the same time, +you can specify which service to use with this field.

templateVoiceTemplate

Required

to_mobilestringrepeated

Required

from_mobilestring

This field is required by some cloud providers.

+ + + + + +

SendVoiceWithTemplateResponse

+

The response of `SendVoiceWithTemplate` method

+ + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
request_idstring

Id of this request.

+ + + + + +

VoiceTemplate

+

VoiceTemplate

+ + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
template_idstring

Required

template_paramsVoiceTemplate.TemplateParamsEntryrepeated

Required

+ + + + + +

VoiceTemplate.TemplateParamsEntry

+

+ + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
keystring

valuestring

+ + + + + + + + + + + + +

Scalar Value Types

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
.proto TypeNotesC++JavaPythonGoC#PHPRuby
doubledoubledoublefloatfloat64doublefloatFloat
floatfloatfloatfloatfloat32floatfloatFloat
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intintint32intintegerBignum or Fixnum (as required)
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/longint64longinteger/stringBignum
uint32Uses variable-length encoding.uint32intint/longuint32uintintegerBignum or Fixnum (as required)
uint64Uses variable-length encoding.uint64longint/longuint64ulonginteger/stringBignum or Fixnum (as required)
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intintint32intintegerBignum or Fixnum (as required)
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/longint64longinteger/stringBignum
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28.uint32intintuint32uintintegerBignum or Fixnum (as required)
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56.uint64longint/longuint64ulonginteger/stringBignum
sfixed32Always four bytes.int32intintint32intintegerBignum or Fixnum (as required)
sfixed64Always eight bytes.int64longint/longint64longinteger/stringBignum
boolboolbooleanbooleanboolboolbooleanTrueClass/FalseClass
stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicodestringstringstringString (UTF-8)
bytesMay contain any arbitrary sequence of bytes.stringByteStringstr[]byteByteStringstringString (ASCII-8BIT)
+ + diff --git a/docs/en/api_reference/README.md b/docs/en/api_reference/README.md index dfc9097e5c..0731db1cef 100644 --- a/docs/en/api_reference/README.md +++ b/docs/en/api_reference/README.md @@ -11,6 +11,8 @@ These protos define Layotto's runtime API, including: In addition to this, Layotto also provides some extension APIs, including: + + email: [spec/proto/extension/v1/email](https://mosn.io/layotto/api/v1/email.html) phone: [spec/proto/extension/v1/phone](https://mosn.io/layotto/api/v1/phone.html) diff --git a/docs/en/api_reference/how_to_generate_api_doc.md b/docs/en/api_reference/how_to_generate_api_doc.md index 0292f05d52..5648ed3d30 100644 --- a/docs/en/api_reference/how_to_generate_api_doc.md +++ b/docs/en/api_reference/how_to_generate_api_doc.md @@ -102,7 +102,7 @@ The steps above generate everything, but what if I only want to generate `.pb.go #### **Make cmmand(recommended)** ```bash -make proto.code +make proto-code ``` This command uses docker to run protoc and generate `.pb.go` code files. @@ -127,14 +127,14 @@ We can use [protoc-gen-doc](https://github.com/pseudomuto/protoc-gen-doc) and do #### **Make command(recommended)** ```bash -make proto.doc +make proto-doc ``` This command uses docker to run protoc-gen-doc and generate docs. #### **Use docker to run protoc-gen-doc** -`make proto.doc` invokes the script `etc/script/generate-doc.sh`, which uses docker to run protoc-gen-doc. +`make proto-doc` invokes the script `etc/script/generate-doc.sh`, which uses docker to run protoc-gen-doc. You can check `etc/script/generate-doc.sh` for more details. - \ No newline at end of file + diff --git a/docs/en/development/commands.md b/docs/en/development/commands.md index 861f150e80..cd686a3ed2 100644 --- a/docs/en/development/commands.md +++ b/docs/en/development/commands.md @@ -18,50 +18,91 @@ Layotto provides powerful commands, which makes contribution and local developme See below commands to know more details or excute `make help`: ``` -Layotto commands 👀: - -A fast and efficient cloud native application runtime 🚀. -Commands below are used in Development 💻 and GitHub workflow 🌊. - -Usage: make ... - -COMMANDS: - build Build layotto for host platform. - build.multiarch Build layotto for multiple platforms. See option PLATFORMS. - image Build docker images for host arch. - image.multiarch Build docker images for multiple platforms. See option PLATFORMS. - push Push docker images to registry. - push.multiarch Push docker images for multiple platforms to registry. - app Build app docker images for host arch. [`/docker/app` contains apps dockerfiles] - app.multiarch Build app docker images for multiple platforms. See option PLATFORMS. - wasm Build layotto wasm for linux arm64 platform. - wasm.multiarch Build layotto wasm for multiple platform. - wasm.image Build layotto wasm image for multiple platform. - wasm.image.push Push layotto wasm image for multiple platform. - check Run all go checks of code sources. - check.lint Run go syntax and styling of go sources. - check.unit Run go unit test. - check.style Run go style test. - style.coverage Run coverage analysis. - style.deadlink Run deadlink check test. - style.quickstart Run quickstart check test. - license Add license headers for code files. - integrate.wasm Run integration test with wasm. - integrate.runtime Run integration test with runtime. - format Format layotto go codes style with gofmt and goimports. - clean Remove all files that are created by building. - all Run format codes, check codes, build Layotto codes for host platform with one command - help Show this help info. - -ARGS: +Layotto is an open source project for a fast and efficient cloud native application runtime. + +Usage: + make