controller

package
v0.0.0-...-e855657 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: GPL-3.0 Imports: 33 Imported by: 0

Documentation

Overview

Package controller Package generate the InboundConfig used by add inbound

Index

Constants

This section is empty.

Variables

Functions

func InboundBuilder

func InboundBuilder(config *Config, nodeInfo *api.NodeInfo, tag string) (*core.InboundHandlerConfig, error)

InboundBuilder build Inbound config for different protocol

func OutboundBuilder

func OutboundBuilder(config *Config, nodeInfo *api.NodeInfo, tag string) (*core.OutboundHandlerConfig, error)

OutboundBuilder build freedom outbound config for addOutbound

func OutboundRelayBuilder

func OutboundRelayBuilder(nodeInfo *api.RelayNodeInfo, tag string, UUID string, Email string, Passwd string, UID int) (*core.OutboundHandlerConfig, error)

Types

type Config

type Config struct {
	CertConfig      *mylego.CertConfig `mapstructure:"CertConfig"`
	EnableFallback  bool               `mapstructure:"EnableFallback"`
	FallBackConfigs []*FallBackConfig  `mapstructure:"FallBackConfigs"`
	EnableDNS       bool               `mapstructure:"EnableDNS"`
	DNSStrategy     string             `mapstructure:"DNSStrategy"`
	IPLimit         *limiter.IPLimit   `mapstructure:"IPLimit"`
}

type Controller

type Controller struct {
	Tag string

	RelayTag string
	Relay    bool
	// contains filtered or unexported fields
}

func New

func New(server *core.Instance, api api.API, config *Config) *Controller

New return a Controller service with default parameters.

func (*Controller) AddInboundLimiter

func (c *Controller) AddInboundLimiter(tag string, nodeSpeedLimit uint64, userList *[]api.UserInfo, globalIPLimit *limiter.IPLimit) error

func (*Controller) AddUserRule

func (c *Controller) AddUserRule(tag string, email []string)

func (*Controller) Close

func (c *Controller) Close() error

Close implement the Close() function of the service interface

func (*Controller) DeleteInboundLimiter

func (c *Controller) DeleteInboundLimiter(tag string) error

func (*Controller) GetDetectResult

func (c *Controller) GetDetectResult(tag string) (*[]api.DetectResult, error)

func (*Controller) GetOnlineDevice

func (c *Controller) GetOnlineDevice(tag string) (*[]api.OnlineIP, error)

func (*Controller) RemoveUserRule

func (c *Controller) RemoveUserRule(email []string)

func (*Controller) Start

func (c *Controller) Start() error

Start implement the Start() function of the service interface

func (*Controller) UpdateInboundLimiter

func (c *Controller) UpdateInboundLimiter(tag string, updatedUserList *[]api.UserInfo) error

func (*Controller) UpdateRule

func (c *Controller) UpdateRule(tag string, newRuleList []api.DetectRule) error

type FallBackConfig

type FallBackConfig struct {
	SNI              string `mapstructure:"SNI"`
	Alpn             string `mapstructure:"Alpn"`
	Path             string `mapstructure:"Path"`
	Dest             string `mapstructure:"Dest"`
	ProxyProtocolVer uint64 `mapstructure:"ProxyProtocolVer"`
}

type ShadowsocksServer

type ShadowsocksServer struct {
	Address  string `json:"address"`
	Port     uint16 `json:"port"`
	Cipher   string `json:"method"`
	Password string `json:"password"`
	Email    string `json:"email"`
	Level    byte   `json:"level"`
	UoT      bool   `json:"uot"`
}

type TrojanServer

type TrojanServer struct {
	Address  string `json:"address"`
	Port     uint16 `json:"port"`
	Password string `json:"password"`
	Email    string `json:"email"`
	Level    byte   `json:"level"`
	Flow     string `json:"flow"`
}

type VLessOutbound

type VLessOutbound struct {
	Address string            `json:"address"`
	Port    uint16            `json:"port"`
	Users   []json.RawMessage `json:"users"`
}

type VMessOutbound

type VMessOutbound struct {
	Address string            `json:"address"`
	Port    uint16            `json:"port"`
	Users   []json.RawMessage `json:"users"`
}

Jump to

Keyboard shortcuts

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