test

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Test = cli.Command{
	Name: "test",
	Subcommands: []*cli.Command{
		&TestRevoke,
		&TestDescribe,
	},
}
View Source
var TestDescribe = cli.Command{
	Name: "describe",
	Action: func(c *cli.Context) error {

		env, _ := godotenv.Read()

		out, err := run.RunEntrypoint(msg.Describe{}, env)
		if err != nil {
			return err
		}
		fmt.Println(string(out.Response))
		return nil
	},
}
View Source
var TestRevoke = cli.Command{
	Name: "revoke",
	Flags: []cli.Flag{
		&cli.StringFlag{Name: "subject"},
		&cli.StringFlag{Name: "target"},
	},
	Action: func(c *cli.Context) error {

		env, _ := godotenv.Read()
		var target msg.Target
		err := json.Unmarshal([]byte(c.String("target")), &target)
		if err != nil {
			return err
		}

		subject := c.String("subject")

		out, err := run.RunEntrypoint(msg.Revoke{Subject: subject, Target: target}, env)
		if err != nil {
			return err
		}
		fmt.Println(string(out.Response))
		return nil
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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