sync

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server        string
	Port          int
	Security      auth.SecurityType
	BaseDN        string
	BindUsername  string
	BindPassword  string
	UserFilter    string
	UserAttribute string
	GroupFilter   string
}

Config represents the command line or environment variable configuration

func (*Config) Validate

func (c *Config) Validate() error

Validate returns an error if the Config is not valid

type Manager

type Manager struct {
	Interval time.Duration
	// contains filtered or unexported fields
}

Manager represents a synchronization manager

func NewManager

func NewManager(config *Config, db *sql.DB, interval time.Duration) (*Manager, error)

NewManager returns a new Manager with the given parameters

func (*Manager) Start

func (m *Manager) Start()

Start starts the sync manager. Multiple calls have no effect

func (*Manager) Stats

func (m *Manager) Stats() (lastRun, nextRun time.Time)

Stats returns stats about the Manager

func (*Manager) Trigger

func (m *Manager) Trigger()

Trigger triggers a synchronization and waits for it to complete. Must be called after Start

Jump to

Keyboard shortcuts

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