service

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TCP = "tcp"
	UDP = "udp"
)

Variables

This section is empty.

Functions

func InboundBuilder

func InboundBuilder(nodeConf *api.ShadowsocksConfig) (*core.InboundHandlerConfig, error)

InboundBuilder build Inbound config for different protocol

func OutboundBuilder

func OutboundBuilder(nodeConf *api.ShadowsocksConfig) (*core.OutboundHandlerConfig, error)

OutboundBuilder build freedom outbund config for addoutbound

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func New

func New(inboundTag string, instance *core.Instance, config *Config, nodeInfo *api.ShadowsocksConfig,
	fetchUsers func(api.NodeId, api.NodeType) (*[]api.User, error), reportTraffics func(api.NodeId, api.NodeType, []*api.UserTraffic) error,
) *Builder

New return a builder lightsail with default parameters.

func (*Builder) Close

func (b *Builder) Close() error

Close implement the Close() function of the lightsail interface

func (*Builder) Start

func (b *Builder) Start() error

Start implement the Start() function of the lightsail interface

type Config

type Config struct {
	FetchUsersInterval     time.Duration
	ReportTrafficsInterval time.Duration
	NodeID                 int
}

type Service

type Service interface {
	Start() error
	Close() error
}

Service is the interface of all the services running in the panel

Jump to

Keyboard shortcuts

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