modules

package
v0.0.0-...-d7c0cb0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Available = make(map[string]Moduler)

The set of registered modules

Functions

func Register

func Register(name string, mod Moduler)

Register a new module as available

Types

type Configuration

type Configuration struct {
	Name         string         `yaml:"name" json:"name"`
	LdapGroups   []string       `yaml:"ldapgroups" json:"ldapgroups"`
	UidMap       []umap         `yaml:"uidmap" json:"uidmap"`
	Create       bool           `yaml:"create" json:"create"`
	Delete       bool           `yaml:"delete" json:"delete"`
	Reset        bool           `yaml:"reset" json:"reset"`
	ResetUsers   string         `yaml:"resetusers" json:"resetusers"`
	Notify       NotifyConf     `yaml:"notify" json:"notify"`
	Credentials  interface{}    `yaml:"credentials" json:"credentials"`
	Parameters   interface{}    `yaml:"parameters" json:"parameters"`
	ApplyChanges bool           `yaml:"applychanges" json:"applychanges"`
	NotifyUsers  bool           `yaml:"notifyusers" json:"notifyusers"`
	LdapCli      mozldap.Client `yaml:"-" json:"-"`
	Debug        bool           `yaml:"-" json:"-"`
}

Configuration holds module specific parameters

func (Configuration) GetCredentials

func (c Configuration) GetCredentials(cred interface{}) (err error)

GetCredentials reads the credentials from a Configuration into the c interface

func (Configuration) GetParameters

func (c Configuration) GetParameters(p interface{}) (err error)

GetParameters reads the parameters from a Configuration into the p interface

type Moduler

type Moduler interface {
	NewRun(Configuration) Runner
}

A module implements this interface

type Notification

type Notification struct {
	Module      string
	Recipient   string
	Mode        string
	Body        []byte
	MustEncrypt bool
}

type NotifyConf

type NotifyConf struct {
	Mode      string            `yaml:"mode" json:"mode"`
	Recipient string            `yaml:"recipient" json:"recipient"`
	Channel   chan Notification `yaml:"-" json:"-"`
}

type Runner

type Runner interface {
	Run() error
}

Runner provides the interface to an execution of a module

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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