types

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Type           = 2
	ConfigFileName = "v2ray.toml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	VMess *VMessConfig `json:"vmess" mapstructure:"vmess"`
}

func NewConfig

func NewConfig() *Config

func ReadInConfig

func ReadInConfig(v *viper.Viper) (*Config, error)

func (*Config) SaveToPath

func (c *Config) SaveToPath(path string) error

func (*Config) String

func (c *Config) String() string

func (*Config) Validate

func (c *Config) Validate() error

func (*Config) WithDefaultValues

func (c *Config) WithDefaultValues() *Config

type Peer

type Peer struct {
	Email string
}

func (Peer) Empty

func (p Peer) Empty() bool

type Peers

type Peers struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewPeers

func NewPeers() *Peers

func (*Peers) Delete

func (p *Peers) Delete(v string)

func (*Peers) Get

func (p *Peers) Get(key string) Peer

func (*Peers) Iterate

func (p *Peers) Iterate(f func(key string, value Peer) (bool, error)) error

func (*Peers) Len

func (p *Peers) Len() int

func (*Peers) Put

func (p *Peers) Put(v Peer)

type Proxy

type Proxy byte

func (Proxy) Account

func (p Proxy) Account(uid uuid.UUID) *anypb.Any

func (Proxy) Byte

func (p Proxy) Byte() byte

func (Proxy) IsValid

func (p Proxy) IsValid() bool

func (Proxy) String

func (p Proxy) String() string

func (Proxy) Tag

func (p Proxy) Tag() string

type Transport

type Transport byte

func NewTransportFromString

func NewTransportFromString(v string) Transport

func (Transport) Byte

func (t Transport) Byte() byte

func (Transport) IsValid

func (t Transport) IsValid() bool

func (Transport) String

func (t Transport) String() string

type VMessConfig

type VMessConfig struct {
	ListenPort uint16 `json:"listen_port" mapstructure:"listen_port"`
	Transport  string `json:"transport" mapstructure:"transport"`
}

func NewVMessConfig

func NewVMessConfig() *VMessConfig

func (*VMessConfig) Validate

func (c *VMessConfig) Validate() error

func (*VMessConfig) WithDefaultValues

func (c *VMessConfig) WithDefaultValues() *VMessConfig

Jump to

Keyboard shortcuts

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