aini

package module
v0.0.0-...-f94024d Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: MIT Imports: 10 Imported by: 0

README

aini

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

Fork from github.com/outten45/aini

Installing

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

go get github.com/moonlight/aini

Then import the package into your project.

import "github.com/moonlight/aini"

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 Groups

type Groups struct {
	*orderedmap.OrderedMap
}

func (Groups) Get

func (g Groups) Get(key string) ([]Host, bool)

func (Groups) Set

func (g Groups) Set(key string, hosts []Host)

type Host

type Host struct {
	Name       string
	Port       int
	User       string
	Pass       string
	PrivateKey string
	PublicIP   string
}

type Hosts

type Hosts struct {
	*Groups
	// contains filtered or unexported fields
}

func NewFile

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

func NewParser

func NewParser(r io.Reader) (*Hosts, error)

func (*Hosts) Match

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

Jump to

Keyboard shortcuts

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