Discover Packages
github.com/pranganmajumder/client-go
command
module
Version:
v0.0.0-...-681645d
Opens a new window with list of versions in this module.
Published: Feb 10, 2021
License: Apache-2.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
Process:
Init Go module & download required dependencies:
Add CLI :
go get github.com/spf13/cobra/cobra
& cobra init --pkg-name client-go
. Here client-go is our repository name
after running the previous command, a root.go file will be created inside cmd folder. No need to modify the root.go file
create another go file inside the cmd folder. This is for our sub-command.
Now implement your sub-command according to your need , Ex: to create sub-command create-deploy
first create variable createCMD
add the function inside the RUN
section, you want to run for your sub-command createCMD
`
inside init() function , add createCMD
to your rootCMD rootCmd.AddCommand(createCMD)
Build:
go build .
this will create a binary file named your project . such as client-go
Or go build -o ./app
this will create a binary file name app
RUN:
./app create new-deploy -r=5 -i=pranganmajumder/go-basic-restapi:1.0.3
./app get list-deploy
will display all the running deployment
./app update update-deploy -r=3 -i=pranganmajumder/go-basic-restapi:1.0.0
./app delete delete-deploy
Expand ▾
Collapse ▴
Documentation
¶
Copyright © 2021 NAME HERE <EMAIL ADDRESS>
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.
Source Files
¶
Directories
¶
Package cmd Copyright © 2021 NAME HERE <EMAIL ADDRESS> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
Package cmd Copyright © 2021 NAME HERE <EMAIL ADDRESS> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
Click to show internal directories.
Click to hide internal directories.