sshconfig

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package sshconfig contains methods for reading and parsing ssh_config files. Once parsing is complete, it will create a new model.Host object from every found host declaration and return an array of hosts.

Package sshconfig provides utilities for parsing and validating SSH configuration files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lexer

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

Lexer is responsible for reading and tokenizing an SSH config file.

func NewFileLexer

func NewFileLexer(filePath string, log iLogger) *Lexer

NewFileLexer creates a new instance of Lexer for the given SSH config file path.

func (*Lexer) Tokenize

func (l *Lexer) Tokenize() []sshToken

Tokenize reads the SSH config file and returns a slice of tokens representing the contents.

type Parser

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

Parser is responsible for parsing SSH configuration tokens into Host models.

func NewParser

func NewParser(lexer lexer, log iLogger) *Parser

NewParser constructs a new Parser instance with the provided lexer and logger.

func (*Parser) Parse

func (p *Parser) Parse() ([]model.Host, error)

Parse processes the tokens from the lexer and constructs a slice of Host models.

Jump to

Keyboard shortcuts

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