cmd

package
v0.0.0-...-0fefa07 Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncryptionPlugins

func EncryptionPlugins(appName string) (kong.Plugins, error)

Types

type CreateKeys

type CreateKeys struct {
	Force   bool          `kong:"help='Overwrite existing data',negatable,short='f'"`
	Timeout time.Duration `kong:"help='Time limit for secreat generation',short='t',default='5s'"`
}

func NewCreateKeys

func NewCreateKeys() *CreateKeys

func (*CreateKeys) Run

func (c *CreateKeys) Run(ctx *GlobalOptions) error

type Decrypt

type Decrypt struct {
	Parse bool     `kong:"help='Parse the input for tokens instead of decrypting everything',negatable,short='p'"`
	File  *os.File `kong:"arg,placeholder='FILE',default='-'"`
}

func NewDecrypt

func NewDecrypt() *Decrypt

func (*Decrypt) Run

func (c *Decrypt) Run(ctx *GlobalOptions) error

type Edit

type Edit struct {
	Preamble bool   `kong:"help='Prefix edit sessions with the informative preamble',negatable,default='true'"`
	Decrypt  bool   `kong:"help='Decrypt existing encrypted content. New content marked properly will be encrypted',negatable,default='true'"`
	Editor   string `kong:"help='Command to invoke for editing if $EDITOR is not set'"`
	File     string `kong:"arg,type='path',placeholder='FILE'"`
}

func NewEdit

func NewEdit() *Edit

func (*Edit) Run

func (c *Edit) Run(ctx *GlobalOptions) error

type Encrypt

type Encrypt struct {
	Parse bool     `kong:"help='Parse the input for tokens instead of encrypting everything',negatable,short='p'"`
	File  *os.File `kong:"arg,placeholder='FILE',default='-'"`
}

func NewEncrypt

func NewEncrypt() *Encrypt

func (*Encrypt) Run

func (c *Encrypt) Run(ctx *GlobalOptions) error

type GlobalOption

type GlobalOption func(*GlobalOptions)

func GlobalAppName

func GlobalAppName(appName string) GlobalOption

func GlobalBaseDir

func GlobalBaseDir(provider func() string) GlobalOption

func GlobalEncryptionPlugins

func GlobalEncryptionPlugins(plugins kong.Plugins) GlobalOption

func GlobalLogger

func GlobalLogger(logger io.Writer) GlobalOption

func GlobalReader

func GlobalReader(reader io.Reader) GlobalOption

func GlobalWriter

func GlobalWriter(writer io.Writer) GlobalOption

type GlobalOptions

type GlobalOptions struct {
	kong.Plugins

	EncryptMethod string          `kong:"help='Override default encryption and decryption method',default='pkcs7',short='n',name='encrypt-method'"`
	Verbose       int             `kong:"help='Increase output verbosity. Repeat for increased verbosity',type='counter',short='v'"`
	Quiet         bool            `kong:"help='Disable any log output.',negatable,short='q'"`
	Config        kong.ConfigFlag `kong:"help='Path to the configuration file',placeholder='FILE'"`
	// contains filtered or unexported fields
}

func NewGlobalOptions

func NewGlobalOptions(options ...GlobalOption) *GlobalOptions

func (*GlobalOptions) AfterApply

func (o *GlobalOptions) AfterApply() error

func (*GlobalOptions) AppName

func (o *GlobalOptions) AppName() string

func (*GlobalOptions) CliGroups

func (o *GlobalOptions) CliGroups() []kong.Group

func (*GlobalOptions) DefaultProvider

func (o *GlobalOptions) DefaultProvider() string

func (*GlobalOptions) Logger

func (o *GlobalOptions) Logger() log.Logger

func (*GlobalOptions) NewEncrypters

func (o *GlobalOptions) NewEncrypters() (crypto.Encrypters, error)

func (*GlobalOptions) Reader

func (o *GlobalOptions) Reader() io.Reader

func (*GlobalOptions) Writer

func (o *GlobalOptions) Writer() io.Writer

type Password

type Password struct {
}

func NewPassword

func NewPassword() *Password

func (*Password) Run

func (c *Password) Run(ctx *GlobalOptions) error

type Recrypt

type Recrypt struct {
	File *os.File `kong:"arg,placeholder='FILE',default='-'"`
}

func NewRecrypt

func NewRecrypt() *Recrypt

func (*Recrypt) Run

func (c *Recrypt) Run(ctx *GlobalOptions) error

type Version

type Version struct {
}

func NewVersion

func NewVersion() *Version

func (*Version) Run

func (c *Version) Run(ctx *GlobalOptions) error

Jump to

Keyboard shortcuts

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