service

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package generate the InbounderConfig used by add inbound

Index

Constants

View Source
const (
	TLS  = "tls"
	TCP  = "tcp"
	WS   = "ws"
	GRPC = "grpc"
)

Variables

This section is empty.

Functions

func InboundBuilder

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

InboundBuilder build Inbound config for different protocol

func OutboundBlockBuilder

func OutboundBlockBuilder() (*core.OutboundHandlerConfig, error)

func OutboundBuilder

func OutboundBuilder(nodeInfo *api.NodeInfo) (*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.NodeInfo,
	getUserList func() ([]*api.UserInfo, error), reportUserTraffic func([]*api.UserTraffic) error,
) *Builder

New return a builder service with default parameters.

func (*Builder) Close

func (b *Builder) Close() error

Close implement the Close() function of the service interface

func (*Builder) Start

func (b *Builder) Start() error

Start implement the Start() function of the service interface

type CertConfig

type CertConfig struct {
	CertFile string
	KeyFile  string
}

type Config

type Config struct {
	SysInterval time.Duration
	Cert        *CertConfig
}

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