cmd

package
v0.0.0-...-8223df7 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Copyright © 2023 Ted van Riel

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func NewDiscordReporter

func NewDiscordReporter(config *Configuration, geo *app.Geo) (*app.DiscordReporter, error)

func NewGeo

func NewGeo(config *Configuration) (*app.Geo, error)

func Serivces

func Serivces(config *Configuration, geo *app.Geo, reporter *app.DiscordReporter) ([]app.Proxy, error)

Types

type ConfigReport

type ConfigReport struct {
	BotToken  string `mapstructure:"token"`
	ChannelID string `mapstructure:"channel"`
}

type ConfigService

type ConfigService struct {
	Name           string              `mapstructure:"name"`
	Listen         string              `mapstructure:"listen"`
	Upstream       string              `mapstructure:"upstream"`
	StandardAction string              `mapstructure:"standard_action"`
	Rules          []ConfigServiceRule `mapstructure:"rules"`
}

type ConfigServiceRule

type ConfigServiceRule struct {
	If     string `yaml:"if"`
	Action string `yaml:"action"`
}

type Configuration

type Configuration struct {
	Db       string          `mapstructure:"db"`
	Report   ConfigReport    `mapstructure:"report"`
	Services []ConfigService `mapstructure:"services"`
}

func NewConfiguration

func NewConfiguration() (*Configuration, error)

Jump to

Keyboard shortcuts

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