ecs

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package ecs provides functions to read, write and manipulate ECS files containing a mGuard configuration.

Index

Constants

View Source
const DefaultPassFileContent = `root\n`

DefaultPassFileContent contains the default content of the 'aca/pass' file of an ECS container.

View Source
const DefaultSnmpdFileContent = `createUser "admin" MD5 "SnmpAdmin" DES "SnmpAdmin"\n`

DefaultSnmpdFileContent contains the default content of the 'aca/snmpd' file of an ECS container.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	Atv   *atv.File
	Users *shadow.File
	// contains filtered or unexported fields
}

Container represents a mGuard ECS container.

func ContainerFromATV

func ContainerFromATV(atv *atv.File) *Container

ContainerFromATV wraps an ATV document in an ECS container.

func ContainerFromFile

func ContainerFromFile(path string) (*Container, error)

ContainerFromFile reads the specified ECS container from disk.

func ContainerFromReader

func ContainerFromReader(reader io.Reader) (*Container, error)

ContainerFromReader reads an ECS container from the specified io.Reader.

func NewContainer

func NewContainer() *Container

NewContainer returns a new and empty ECS container.

func (*Container) Dupe

func (container *Container) Dupe() *Container

Dupe returns a copy of the ECS container.

func (*Container) ToFile

func (container *Container) ToFile(path string) error

ToFile saves the ECS container to the specified file.

func (*Container) ToWriter

func (container *Container) ToWriter(writer io.Writer) error

ToWriter writes the ECS container to the specified io.Writer.

Jump to

Keyboard shortcuts

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