spiry

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ISO8601 = "2006-01-02T15:04:05-0700"

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Debug   bool             `short:"D" help:"Enable debug mode"`
	Version kong.VersionFlag `name:"version" short:"v" help:"display version information and exit"`

	// output formatting flags are mutually exclusive
	BareFlag bool   `name:"bare" short:"b" xor:"output" help:"only display expiration date"`
	JsonFlag bool   `name:"json" short:"j" xor:"output" help:"display output as JSON"`
	Output   string `kong:"-"`

	// time formatting flags are mutually exclusive
	UnixFlag     bool   `name:"unix" short:"u" xor:"time" help:"display expiration date as UNIX timestamp"`
	Rfc1123zFlag bool   `name:"rfc1123z" short:"r" xor:"time" help:"display expiration date as RFC1123Z timestamp"`
	Rfc3339Flag  bool   `name:"rfc3339" short:"R" xor:"time" help:"display expiration date as RFC3339 timestamp"`
	Time         string `kong:"-"`
}

func (*Command) Render

func (g *Command) Render(res ExpiringResource) (output string, err error)

type ExpiringResource

type ExpiringResource interface {
	Name() string
	Expiry() (time.Time, error)
}

Jump to

Keyboard shortcuts

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