key

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cobra.Command{
	Use:   "key",
	Short: "Manage GPG keys",
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("Key requires a subcommand:")
		for _, command := range cmd.Commands() {
			fmt.Println(command.Name())
		}
	},
}

Command represents this folder's command

Functions

func GetGPGKeyFingerprints

func GetGPGKeyFingerprints(context context.Context, cmd *cobra.Command) []string

GetGPGKeyFingerprints gets the fingerprints of the GPGKeys

Types

type GPGKey

type GPGKey struct {
	Type        string       `json:"type" mapstructure:"type"`
	Parent      string       `json:"parent_fingerprint" mapstructure:"parent_fingerprint"`
	Fingerprint string       `json:"fingerprint" mapstructure:"fingerprint"`
	KeyID       string       `json:"key_id" mapstructure:"key_id"`
	Name        string       `json:"name" mapstructure:"name"`
	AddedOn     time.Time    `json:"added_on" mapstructure:"added_on"`
	CreatedOn   time.Time    `json:"created_on" mapstructure:"created_on"`
	Links       common.Links `json:"links" mapstructure:"links"`
	Owner       user.User    `json:"owner" mapstructure:"owner"`
}

func GetGPGKeys

func GetGPGKeys(context context.Context, cmd *cobra.Command) (keys []GPGKey, err error)

GetGPGKeys gets the GPGKeys

func (GPGKey) GetHeader

func (key GPGKey) GetHeader(short bool) []string

GetHeader gets the header for a table

implements common.Tableable

func (GPGKey) GetRow

func (key GPGKey) GetRow(headers []string) []string

GetRow gets the row for a table

implements common.Tableable

func (GPGKey) MarshalJSON

func (key GPGKey) MarshalJSON() ([]byte, error)

MarshalJSON marshals the GPGKey

implements json.Marshaler

func (GPGKey) String

func (key GPGKey) String() string

String gets a string representation of the GPGKey

implements fmt.Stringer

func (GPGKey) Validate

func (key GPGKey) Validate() error

Validate validates the GPGKey

type GPGKeys

type GPGKeys []GPGKey

func (GPGKeys) GetHeader

func (keys GPGKeys) GetHeader() []string

GetHeader gets the header for a table

implements common.Tableables

func (GPGKeys) GetRowAt

func (keys GPGKeys) GetRowAt(index int, headers []string) []string

GetRowAt gets the row for a table

implements common.Tableables

func (GPGKeys) Size

func (keys GPGKeys) Size() int

Size gets the number of elements

implements common.Tableables

Jump to

Keyboard shortcuts

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