ssh

package
v1.618.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Options(
	fx.Provide(NewToken),
)

Module for fx.

Functions

func IsEnabled

func IsEnabled(cfg *Config) bool

IsEnabled for ssh.

Types

type Config

type Config struct {
	Key  *Key `yaml:"key,omitempty" json:"key,omitempty" toml:"key,omitempty"`
	Keys Keys `yaml:"keys,omitempty" json:"keys,omitempty" toml:"keys,omitempty"`
}

Config for ssh.

type Key

type Key struct {
	*ssh.Config `yaml:",inline" json:",inline" toml:",inline"`
	Name        string `yaml:"name,omitempty" json:"name,omitempty" toml:"name,omitempty"`
}

Key configuration with a name and ssh key.

type Keys

type Keys []*Key

Keys configuration with a names and ssh keys.

func (Keys) Get

func (c Keys) Get(name string) *Key

Get a key by name.

type Token

type Token struct {
	// contains filtered or unexported fields
}

Token for ssh.

func NewToken

func NewToken(fs *os.FS, cfg *Config) *Token

NewToken for ssh.

func (*Token) Generate

func (t *Token) Generate() (string, error)

Generate an SSH token.

func (*Token) Verify

func (t *Token) Verify(token string) error

Verify an SSH token.

Jump to

Keyboard shortcuts

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