Documentation ¶
Index ¶
- func GetFilePaths(p string) ([]string, error)
- type AddOption
- type HostConfig
- func Add(p string, ao *AddOption) (*HostConfig, error)
- func Delete(p string, aliases ...string) ([]*HostConfig, error)
- func List(p string, lo ListOption) ([]*HostConfig, error)
- func NewHostConfig(alias, path string, host *ssh_config.Host) *HostConfig
- func Update(p string, uo *UpdateOption) (*HostConfig, error)
- type ListOption
- type UpdateOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFilePaths ¶ added in v0.5.1
GetFilePaths get file paths
Types ¶
type AddOption ¶ added in v0.5.0
type AddOption struct { // Path add path Path string // Alias alias Alias string // Connect connection string Connect string // Config other config Config map[string]string }
AddOption options for Add
type HostConfig ¶ added in v0.3.0
type HostConfig struct { // Alias alias Alias string // Path found in which file Path string // PathMap key is file path, value is the alias's hosts PathMap map[string][]*ssh_config.Host // OwnConfig own config OwnConfig map[string]string // ImplicitConfig implicit config ImplicitConfig map[string]string }
HostConfig struct include alias, connect string and other config
func Add ¶ added in v0.3.0
func Add(p string, ao *AddOption) (*HostConfig, error)
Add ssh host config to ssh config file
func Delete ¶ added in v0.3.0
func Delete(p string, aliases ...string) ([]*HostConfig, error)
Delete existing alias record
func List ¶ added in v0.3.0
func List(p string, lo ListOption) ([]*HostConfig, error)
List ssh alias, filter by optional keyword
func NewHostConfig ¶ added in v0.5.0
func NewHostConfig(alias, path string, host *ssh_config.Host) *HostConfig
NewHostConfig new HostConfig
func Update ¶ added in v0.3.0
func Update(p string, uo *UpdateOption) (*HostConfig, error)
Update existing record
func (*HostConfig) ConnectionStr ¶ added in v0.5.1
func (hc *HostConfig) ConnectionStr() string
ConnectionStr return the connection string
func (*HostConfig) Display ¶ added in v0.5.0
func (hc *HostConfig) Display() bool
Display Whether to display connection string
type ListOption ¶ added in v0.5.0
type ListOption struct { // Keywords set Keyword filter records Keywords []string // IgnoreCase ignore case IgnoreCase bool }
ListOption options for List
type UpdateOption ¶ added in v0.5.0
type UpdateOption struct { // Alias alias Alias string // NewAlias new alias NewAlias string // Connect connection string Connect string // Config other config Config map[string]string }
UpdateOption options for Update
func (*UpdateOption) Valid ¶ added in v0.5.0
func (uo *UpdateOption) Valid() bool
Valid whether the option is valid
Click to show internal directories.
Click to hide internal directories.