v2ray

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2019 License: MPL-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SyncResponse

type SyncResponse struct {
	Add    []string
	Delete []string
}

SyncResponse of sync func

type User

type User struct {
	gorm.Model
	Email string `gorm:"unique_index;not null;column:email"`
	UUID  string `gorm:"unique;not null;column:uuid"`
}

User v2ray

type V2ray

type V2ray struct {
	RemoteTag  string // remote v2ray tag
	RemoteGrpc string // grpc addr

	APIPort uint32 // remote v2ray api port
	WsPort  uint32 // ws port
	WsPath  string // ws path

	DB        *gorm.DB // db for storage user uuid
	VNEXT     string   // 如果有 VNEXT 将会替换默认 outbound
	SocksPort uint32   // 如果有值则暴露一个无需认证的 socks 端口
	// contains filtered or unexported fields
}

V2ray remote handler wrapper must sync at first time

func (V2ray) AddUsers

func (v2 V2ray) AddUsers(users []User) (errs []error)

AddUsers v2ray

func (V2ray) GetConfig

func (v2 V2ray) GetConfig() *core.Config

GetConfig expose v2ray config

func (V2ray) GetDBUsers added in v0.3.0

func (v2 V2ray) GetDBUsers() (users []User, err error)

GetDBUsers in sqlite db

func (V2ray) RemoveUsers

func (v2 V2ray) RemoveUsers(users []User) (errs []error)

RemoveUsers v2ray

func (V2ray) Sync

func (v2 V2ray) Sync(ldapUsers []string, confirm bool) (resp SyncResponse, err error)

Sync ldap user to here TODO: add test v2ray grpc manager

Jump to

Keyboard shortcuts

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