Categorygithub.com/r2dtools/a2conf
repositorypackage
0.1.0
Repository: https://github.com/r2dtools/a2conf.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

a2conf

Parse and manipulate with apache2 config using augeas library

Installation

go get r2dtools/a2conf

Example

import (
	"encoding/json"
	"fmt"

	"github.com/r2dtools/a2conf"
)

func main() {
	configurator, err := a2conf.GetApacheConfigurator(nil)

	if err != nil {
		panic(fmt.Sprintf("could not create apache configurator: %v", err))
	}

	vhosts, err := configurator.GetVhosts()

	if err != nil {
		panic(fmt.Sprintf("could not get virtual hosts: %v", err))
	}

	jsonVhosts, _ := json.Marshal(vhosts)
	fmt.Printf("vhsosts: %v", string(jsonVhosts))
}