model

package
v0.0.0-...-f62b39d Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRedisClient

func InitRedisClient(c config.RedisConf) (redisClient *redis.Client)

InitRedisClient 初始化redis客户端

Types

type CcdDetail

type CcdDetail struct {
	Username string
	Vip      string
	Cidrs    []string
}

CcdDetail ccd文件详情

type UvpnModel

type UvpnModel interface {
	// GenUserCcd 生成用户ccd文件
	GenUserCcd(username string) (vip string, cidrs []string, err error)
	// AddUserPriv 为用户增加权限
	AddUserPriv(username, realName string, newCidrs []string) (vip string, cidrs []string, err error)
	// AddAllUserPriv 为所有用户增加权限
	AddAllUserPriv(newCidrs []string) (allCcdDetail []CcdDetail, err error)
	// DelUserCcd 删除用户ccd文件
	DelUserCcd(username string) (err error)
	// GetUserPriv 获取用户权限信息
	GetUserPriv(username string) (vip string, cidrs []string, err error)
	// CleanUpAllUserCcd 清理所有用户ccd文件
	CleanUpAllUserCcd() (err error)
}

func NewUvpnModel

func NewUvpnModel(c config.Config) UvpnModel

type UvpnPrivAttr

type UvpnPrivAttr struct {
	Username string
	Vip      string
	Cidrs    []string
}

UvpnPrivAttr 一个用户的uvpn权限包含的内容

Jump to

Keyboard shortcuts

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