app

package
v0.0.0-...-3153bc2 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const CaddyAppID = "trojan"

CaddyAppID is ...

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// UpstreamRaw is ...
	UpstreamRaw json.RawMessage `json:"upstream" caddy:"namespace=trojan.upstreams inline_key=upstream"`
	// ProxyRaw is ...
	ProxyRaw json.RawMessage `json:"proxy" caddy:"namespace=trojan.proxies inline_key=proxy"`
	// Users is ...
	Users []string `json:"users,omitempty"`
	// contains filtered or unexported fields
}

App is ...

func (App) CaddyModule

func (App) CaddyModule() caddy.ModuleInfo

CaddyModule is ...

func (*App) Provision

func (app *App) Provision(ctx caddy.Context) error

Provision is ...

func (*App) Proxy

func (app *App) Proxy() Proxy

Proxy is ...

func (*App) Start

func (app *App) Start() error

Start is ...

func (*App) Stop

func (app *App) Stop() error

Stop is ...

func (*App) Upstream

func (app *App) Upstream() Upstream

Upstream is ...

type CaddyUpstream

type CaddyUpstream struct {
	// Prefix is ...
	Prefix string `json:"-,omitempty"`
	// Storage is ...
	Storage certmagic.Storage `json:"-,omitempty"`
	// Logger is ...
	Logger *zap.Logger `json:"-,omitempty"`
}

CaddyUpstream is ...

func (*CaddyUpstream) Add

func (u *CaddyUpstream) Add(s string) error

Add is ...

func (CaddyUpstream) CaddyModule

func (CaddyUpstream) CaddyModule() caddy.ModuleInfo

CaddyModule is ...

func (*CaddyUpstream) Consume

func (u *CaddyUpstream) Consume(k string, nr, nw int64) error

Consume is ...

func (*CaddyUpstream) Delete

func (u *CaddyUpstream) Delete(s string) error

Delete is ...

func (*CaddyUpstream) Provision

func (u *CaddyUpstream) Provision(ctx caddy.Context) error

Provision is ...

func (*CaddyUpstream) Range

func (u *CaddyUpstream) Range(fn func(k string, up, down int64))

Range is ...

func (*CaddyUpstream) Validate

func (u *CaddyUpstream) Validate(k string) bool

Validate is ...

type EnvProxy

type EnvProxy struct {
	proxy.Dialer `json:"-,omitempty"`
}

EnvProxy is ...

func (EnvProxy) CaddyModule

func (EnvProxy) CaddyModule() caddy.ModuleInfo

CaddyModule is ...

func (*EnvProxy) Close

func (*EnvProxy) Close() error

Close is ...

func (*EnvProxy) Handle

func (p *EnvProxy) Handle(r io.Reader, w io.Writer) (int64, int64, error)

Handle is ...

func (*EnvProxy) ListenPacket

func (*EnvProxy) ListenPacket(network, addr string) (net.PacketConn, error)

ListenPacket is ...

func (*EnvProxy) Provision

func (p *EnvProxy) Provision(ctx caddy.Context) error

Provision is ...

type MemoryUpstream

type MemoryUpstream struct {
	// UpstreamRaw is ...
	UpstreamRaw json.RawMessage `json:"persist" caddy:"namespace=trojan.upstreams inline_key=upstream"`
	// contains filtered or unexported fields
}

MemoryUpstream is ...

func (*MemoryUpstream) Add

func (u *MemoryUpstream) Add(s string) error

Add is ...

func (*MemoryUpstream) AddKey

func (u *MemoryUpstream) AddKey(key string)

AddKey is ...

func (MemoryUpstream) CaddyModule

func (MemoryUpstream) CaddyModule() caddy.ModuleInfo

CaddyModule is ...

func (*MemoryUpstream) Cleanup

func (u *MemoryUpstream) Cleanup() error

Cleanup is ...

func (*MemoryUpstream) Consume

func (u *MemoryUpstream) Consume(k string, nr, nw int64) error

Consume is ...

func (*MemoryUpstream) Delete

func (u *MemoryUpstream) Delete(s string) error

Delete is ...

func (*MemoryUpstream) Provision

func (u *MemoryUpstream) Provision(ctx caddy.Context) error

Provision is ...

func (*MemoryUpstream) Range

func (u *MemoryUpstream) Range(fn func(string, int64, int64))

Range is ...

func (*MemoryUpstream) Validate

func (u *MemoryUpstream) Validate(k string) bool

Validate is ...

type NoProxy

type NoProxy struct{}

NoProxy is ...

func (NoProxy) CaddyModule

func (NoProxy) CaddyModule() caddy.ModuleInfo

CaddyModule is ...

func (*NoProxy) Close

func (*NoProxy) Close() error

Close is ...

func (*NoProxy) Handle

func (*NoProxy) Handle(r io.Reader, w io.Writer) (int64, int64, error)

Handle is ...

type Proxy

type Proxy interface {
	// Handle is ...
	Handle(r io.Reader, w io.Writer) (int64, int64, error)
	// Closer is ...
	io.Closer
}

Proxy is ...

type Task

type Task struct {
	Type  TaskType
	Value struct {
		Password string
		Key      string
		Traffic
	}
}

Task is ...

type TaskType

type TaskType int

TaskType is ...

const (
	TaskAdd TaskType = iota
	TaskDelete
	TaskConsume
)

type Traffic

type Traffic struct {
	// Up is ...
	Up int64 `json:"up"`
	// Down is ...
	Down int64 `json:"down"`
}

Traffic is ...

type Upstream

type Upstream interface {
	// Add is ...
	Add(string) error
	// Delete is ...
	Delete(string) error
	// Range is ...
	Range(func(string, int64, int64))
	// Validate is ...
	Validate(string) bool
	// Consume is ...
	Consume(string, int64, int64) error
}

Upstream is ...

Jump to

Keyboard shortcuts

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