cmd

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "sweetcher",
	Short: "Sweetcher is a system proxy switcher based on rules",
	Long: `For those who know the hell of enterprise proxies!
Sweetcher is inspired for web browsers proxy switcher plugins but allow to do it as
your system proxy. Just configure it as your default system proxy and configure it
using rules defined in profiles`,
}

RootCmd is the root cli command

Functions

This section is empty.

Types

type Config

type Config struct {
	Server   Server             `json:"server,omitempty" mapstructure:"server"`
	Proxies  map[string]string  `json:"proxies,omitempty" mapstructure:"proxies"`
	Profiles map[string]Profile `json:"profiles,omitempty" mapstructure:"profiles"`
}

Config is the root of a configuration file

type Profile

type Profile struct {
	Default string `json:"default,omitempty" mapstructure:"default"`
	Rules   []Rule `json:"rules,omitempty" mapstructure:"rules"`
}

Profile represents a Profile definition

type Rule

type Rule struct {
	HostWildcard string `json:"host_wildcard,omitempty" mapstructure:"host_wildcard"`
	Proxy        string `json:"proxy,omitempty" mapstructure:"proxy"`
}

Rule is a routing rule to a proxy

type Server

type Server struct {
	Logs struct {
		Level string `json:"level,omitempty" mapstructure:"level"`
	} `json:"logs,omitempty" mapstructure:"logs"`
	Address string `json:"address,omitempty" mapstructure:"address"`
	Profile string `json:"profile,omitempty" mapstructure:"profile"`
}

Server represents a Sweetcher server configuration file

Jump to

Keyboard shortcuts

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