utils

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SSRServer = iota
	SSRPort
	SSRProtocol
	SSRCipher
	SSROBFS
	SSRSuffix
)

Variables

This section is empty.

Functions

func Base64DecodeStripped

func Base64DecodeStripped(s string) (string, error)

func CopyFile

func CopyFile(from, to string) error

func DownloadWithProgressbar

func DownloadWithProgressbar(fileUrl, fileName string) error

func FileExists

func FileExists(path string) bool

func FileRead

func FileRead(filename string) (content string, err error)

func FileWrite

func FileWrite(filename string, content string) error

func GetConfigDir

func GetConfigDir() string

func GetExecPath

func GetExecPath() string

func GetExitSign added in v0.0.5

func GetExitSign() chan os.Signal

func GetFileModTime added in v0.0.5

func GetFileModTime(path string) time.Time

func GetProxyNodeType

func GetProxyNodeType(u string) domain.ProxyNodeType

func GetPwd

func GetPwd() string

func GetRealIpFromCtx added in v0.0.4

func GetRealIpFromCtx(ctx *fiber.Ctx) string

func GetUserConfigDir added in v0.0.5

func GetUserConfigDir() string

func GetUserHomeDir added in v0.0.5

func GetUserHomeDir() string

func IsDir

func IsDir(path string) bool

func IsFile

func IsFile(path string) bool

func IsIp

func IsIp(ip string) bool

func IsIpV4

func IsIpV4(ip string) bool

func IsIpV6

func IsIpV6(ip string) bool

func Md5 added in v0.0.4

func Md5(s string) string

func Now

func Now() uint32

func RandStringRunes

func RandStringRunes(n int) string

func SetProxy

func SetProxy(proxyIp, pacUrl string)

func Sha224 added in v0.0.4

func Sha224(s string) string

func Sha256 added in v0.0.4

func Sha256(s string) string

func Sha384 added in v0.0.4

func Sha384(s string) string

func Sha512 added in v0.0.4

func Sha512(s string) string

func ShortStr

func ShortStr(str string, max int) string

func ShortStr4Web

func ShortStr4Web(str string, max int) string

Types

type ClashRSSR

type ClashRSSR struct {
	Name          string      `json:"name"`
	Type          string      `json:"type"`
	Server        string      `json:"server"`
	Port          interface{} `json:"port"`
	Password      string      `json:"password"`
	Cipher        string      `json:"cipher"`
	Protocol      string      `json:"protocol"`
	ProtocolParam string      `json:"protocol-param"`
	OBFS          string      `json:"obfs"`
	OBFSParam     string      `json:"obfs-param"`
}

type ClashSS

type ClashSS struct {
	Name       string      `json:"name"`
	Type       string      `json:"type"`
	Server     string      `json:"server"`
	Port       interface{} `json:"port"`
	Password   string      `json:"password"`
	Cipher     string      `json:"cipher"`
	Plugin     string      `json:"plugin"`
	PluginOpts PluginOpts  `json:"plugin-opts"`
}

type ClashVmess

type ClashVmess struct {
	Name           string            `json:"name,omitempty"`
	Type           string            `json:"type,omitempty"`
	Server         string            `json:"server,omitempty"`
	Port           interface{}       `json:"port,omitempty"`
	UUID           string            `json:"uuid,omitempty"`
	AlterID        interface{}       `json:"alterId,omitempty"`
	Cipher         string            `json:"cipher,omitempty"`
	TLS            bool              `json:"tls,omitempty"`
	Network        string            `json:"network,omitempty"`
	WSPATH         string            `json:"ws-path,omitempty"`
	WSHeaders      map[string]string `json:"ws-headers,omitempty"`
	SkipCertVerify bool              `json:"skip-cert-verify,omitempty"`
}

type Ecc

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

func NewEcc

func NewEcc() *Ecc

func (*Ecc) ECCDecrypt

func (p *Ecc) ECCDecrypt(ct string) (string, error)

ecc(ecies)解密

func (*Ecc) ECCEncrypt

func (p *Ecc) ECCEncrypt(pt interface{}) (string, error)

ess 加密

func (*Ecc) ECCEncrypt4Bytes

func (p *Ecc) ECCEncrypt4Bytes(pt []byte) (string, error)

ess 加密

func (*Ecc) ECCEncrypt4Str

func (p *Ecc) ECCEncrypt4Str(pt string) (string, error)

ess 加密

func (*Ecc) EccSign

func (p *Ecc) EccSign(pt []byte) (sign []byte, err error)

ecc签名

func (*Ecc) EccSignVer

func (p *Ecc) EccSignVer(pt, sign []byte) bool

ecc验签

func (*Ecc) GetPrivate

func (p *Ecc) GetPrivate() *ecdsa.PrivateKey

func (*Ecc) Init

func (p *Ecc) Init(key string) error

type PluginOpts

type PluginOpts struct {
	Mode string `json:"mode"`
	Host string `json:"host"`
}

type SSD

type SSD struct {
	Airport      string  `json:"airport"`
	Port         int     `json:"port"`
	Encryption   string  `json:"encryption"`
	Password     string  `json:"password"`
	TrafficUsed  float64 `json:"traffic_used"`
	TrafficTotal float64 `json:"traffic_total"`
	Expiry       string  `json:"expiry"`
	URL          string  `json:"url"`
	Servers      []struct {
		ID            int     `json:"id"`
		Server        string  `json:"server"`
		Ratio         float64 `json:"ratio"`
		Remarks       string  `json:"remarks"`
		Port          string  `json:"port"`
		Encryption    string  `json:"encryption"`
		Password      string  `json:"password"`
		Plugin        string  `json:"plugin"`
		PluginOptions string  `json:"plugin_options"`
	} `json:"servers"`
}

type Trojan

type Trojan struct {
	Name     string      `json:"name"`
	Type     string      `json:"type"`
	Server   string      `json:"server"`
	Password string      `json:"password"`
	Sni      string      `json:"sni,omitempty"`
	Port     interface{} `json:"port"`
}

type Vmess

type Vmess struct {
	Add  string      `json:"add"`
	Aid  interface{} `json:"aid"`
	Host string      `json:"host"`
	ID   string      `json:"id"`
	Net  string      `json:"net"`
	Path string      `json:"path"`
	Port interface{} `json:"port"`
	PS   string      `json:"ps"`
	TLS  string      `json:"tls"`
	Type string      `json:"type"`
	V    interface{} `json:"v"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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