config

package
v0.0.0-...-6865f78 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2015 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package config provides utilities for dealing with configuration files for recond.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	sync.Mutex
	UID          string // Unique Identifier to register with marksman
	HostName     string
	PolicyConfig policy.Config
}

Config represents the configuration for the recond running on a particular machine.

func Init

func Init() (*Config, error)

Init initializes and returns a Config. i.e. if the config file doesn't exist, it generates an new UID, creates the config file and returns the corresponding Config.

func (*Config) AddPolicy

func (c *Config) AddPolicy(p policy.Policy) error

func (*Config) Save

func (c *Config) Save() error

Save saves the config in a configuration file. If it already exists, it removes it and writes it freshly. Make sure you lock and unlock the config while calling Save.

Jump to

Keyboard shortcuts

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