client-go

command module
v0.0.0-...-681645d Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

Go Report Card

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

Documentation

Overview

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.

Directories

Path Synopsis
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.

Jump to

Keyboard shortcuts

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