template

package
v0.8.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetCmd = &cobra.Command{
	Use:                   "get [id]",
	Short:                 "get a template",
	Example:               "tink template get [id]",
	DisableFlagsInUseLine: true,
	Args: func(c *cobra.Command, args []string) error {
		if len(args) == 0 {
			return fmt.Errorf("%v requires an argument", c.UseLine())
		}
		return nil
	},
	Run: func(c *cobra.Command, args []string) {
		for _, arg := range args {
			req := template.GetRequest{}

			if _, err := uuid.Parse(arg); err == nil {

				req.GetBy = &template.GetRequest_Id{Id: arg}
			} else {

				req.GetBy = &template.GetRequest_Name{Name: arg}
			}
			t, err := client.TemplateClient.GetTemplate(context.Background(), &req)
			if err != nil {
				log.Fatal(err)
			}
			fmt.Println(t.Data)
		}
	},
}

GetCmd represents the get subcommand for template command.

Functions

func NewCreateCommand added in v0.5.0

func NewCreateCommand() *cobra.Command

func NewDeleteOptions added in v0.5.0

func NewDeleteOptions() delete.Options

func NewGetOptions added in v0.5.0

func NewGetOptions() get.Options

func NewListCommand added in v0.5.0

func NewListCommand() *cobra.Command

listCmd represents the list subcommand for template command.

func NewUpdateCommand added in v0.5.0

func NewUpdateCommand() *cobra.Command

updateCmd represents the get subcommand for template command.

Types

This section is empty.

Jump to

Keyboard shortcuts

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