motifini

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Binary             = "motifini"
	DefaultRepeatDelay = time.Minute
	DefaultEnvPrefix   = "MO"
)

Variables

This section is empty.

Functions

func Start

func Start() error

Start the daemon.

Types

type Config

type Config struct {
	Global struct {
		Port      uint     `toml:"port"`
		TempDir   string   `toml:"temp_dir"`
		StateFile string   `toml:"state_file"`
		AllowedTo []string `toml:"allowed_to"`
		Debug     bool
	} `toml:"motifini"`
	Imessage    *imessage.Config `toml:"imessage"`
	SecuritySpy *server.Config   `toml:"security_spy"`
}

Configuration for Motifini.

func (*Config) Validate

func (c *Config) Validate()

Validate makes sure the data in the config file is valid.

type Flags

type Flags struct {
	EnvPrefix  string
	ConfigFile string
	VersionReq bool
	*pflag.FlagSet
}

Flags defines our application's CLI arguments.

func (*Flags) ParseArgs

func (flag *Flags) ParseArgs(args []string)

ParseArgs runs the parser for CLI arguments.

type Motifini

type Motifini struct {
	Flag  *Flags
	Conf  *Config
	HTTP  *webserver.Config
	SSpy  *securityspy.Server
	Subs  *subscribe.Subscribe
	Msgs  *messenger.Messenger
	Info  *log.Logger
	Error *log.Logger
	Debug *log.Logger
}

Motifini is the main application struct.

func (*Motifini) ParseConfigFile

func (m *Motifini) ParseConfigFile() error

ParseConfigFile parses and returns our configuration data. Supports a few formats for config file: xml, json, toml.

func (*Motifini) ProcessEventStream

func (m *Motifini) ProcessEventStream()

ProcessEventStream processes the securityspy event stream.

func (*Motifini) Run

func (m *Motifini) Run() (err error)

Run starts the app after all configs are collected.

Jump to

Keyboard shortcuts

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