cmd

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

This section is empty.

Variables

View Source
var InternalFS fs.FS

InternalFS is a global variable shared within the whole cmd package. It is set in the `Execute()` when main function run because go embed cannot access parent directory.

Functions

func Execute

func Execute(internalFS fs.FS)

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

type Command added in v1.1.5

type Command struct {
	ProjectObject Project
	CommandName   string
}

type DockerComposefile added in v1.4.0

type DockerComposefile struct {
	ProjectObject Project
	AppPort       int
}

type Dockerfile added in v1.4.0

type Dockerfile struct {
	ProjectObject Project
	GoVersion     string
	AppPort       int
}

type Handler added in v1.1.5

type Handler struct {
	ProjectObject    Project
	HandlerNameUpper string
	HandlerNameLower string
	ServiceExists    bool
}

type Project

type Project struct {
	// Copyright is the copyright text on the top of every files.
	Copyright string
	// PkgPath is the full string of the generated package. (example: github.com/retail-ai-inc/bean)
	PkgPath string
	// PkgName is the suffix of the package path, it should match the current directory name.
	PkgName string
	// RootDir is the project root directory or current directory when executing the bean command.
	RootDir string
	// SubDir is the sub directory under project root using for some commands. (example: upgrade need ./framework)
	SubDir string
	// RootFS contains the internal FS directory which need to be walk through recursively,
	// different cmd may starts with different root path.(init: internal/project, upgrade: internal/project/framework).
	RootFS fs.FS
	// Secret is similar like a passphrase to hold a key to generate tokens, hash password or similar security credentials.
	Secret string
	// JWT secret/salt
	JWTSecret string
	// API Authorization: bearer token to delete a key from Memory database via API call.
	BearerToken string
}

Project holds some necessary data for some cmd.

type Repo added in v1.1.5

type Repo struct {
	ProjectObject Project
	RepoNameUpper string
	RepoNameLower string
}

type Service added in v1.1.5

type Service struct {
	ProjectObject    Project
	ServiceNameUpper string
	ServiceNameLower string
	RepoExists       bool
}

Directories

Path Synopsis
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.

Jump to

Keyboard shortcuts

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