aini

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: AGPL-3.0, MIT Imports: 9 Imported by: 0

README

fork of aini with additional fields

Source: https://github.com/outten45/aini

Simple library for parsing Ansible host files (ini) in Go.

Installing

Use the 'go get' command to download the package.

go get github.com/outten45/aini

Then import the package into your project.

import "github.com/outten45/aini"

TODO

  • expanding host names
  • :vars and :children in the group
  • additional ssh options

Credits

To the Ansible team for writing easy to follow code.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host struct {
	Name       string
	Host       string
	Port       int
	User       string
	SSHPass    string
	BecomePass string
	PrivateKey string
}

type Hosts

type Hosts struct {
	Groups map[string][]*Host
	Hosts  map[string]*Host
	// contains filtered or unexported fields
}

func NewFile

func NewFile(f string, defaults Host) (*Hosts, error)

func NewParser

func NewParser(r io.Reader, defaults Host) *Hosts

func (*Hosts) Match

func (h *Hosts) Match(m string) []*Host

func (*Hosts) MatchOne

func (h *Hosts) MatchOne(m string) *Host

Jump to

Keyboard shortcuts

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