server

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limit added in v1.8.3

type Limit struct {
	DownLink  uint
	UpLink    uint
	Bandwidth uint
}

type SSL

type SSL struct {
	PublicKey  string `json:"cert"` // certificate path
	PrivateKey string `json:"key"`  // certificate key path
}

type Server

type Server struct {
	Listen  string `json:"listen"`
	SSL     *SSL   `json:"ssl,omitempty"`
	Path    string `json:"path,omitempty"` // grpc service name
	Users   Users  `json:"users"`
	Buffer  uint16 `json:"buffer,omitempty"`  // transport buffer size in KB, up to 65535
	IPv6    bool   `json:"ipv6,omitempty"`    // enable ipv6 in tcp network, disable by default
	Forward string `json:"forward,omitempty"` // extra forward-proxy
}

type User

type User struct {
	UUID   string `json:"uuid"` // user id
	Limit  *Limit `json:"limit,omitempty"`
	Remark string `json:"remark,omitempty"`
}

type Users

type Users []*User

func (Users) Match

func (u Users) Match(id string) bool

Match returns true if the user id is in the users list may use map for fast lookup in the future

func (Users) NullOrEmpty added in v1.9.3

func (u Users) NullOrEmpty() bool

func (Users) ToMatchMap added in v1.9.3

func (u Users) ToMatchMap() *UsersMatchMap

type UsersMatchMap added in v1.9.3

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

func NewUsersMatchMap added in v1.9.3

func NewUsersMatchMap(users Users) *UsersMatchMap

func (*UsersMatchMap) Match added in v1.9.3

func (m *UsersMatchMap) Match(id string) bool

Jump to

Keyboard shortcuts

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