utils

package
v0.0.3-alpha3 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EM_FileIO_NotExist = types.NewMask(
		"FileIO:NotExist",
		"文件不存在:{{path}}",
	)
	EM_FileIO_FailedToGetStat = types.NewMask(
		"FileIO:FailedToGetStat",
		"无法获取文件状态:{{path}}",
	)
	EM_FileIO_FailedToParse_AbsPath = types.NewMask(
		"FileIO:FailedTo_ParseAbsPath",
		"无法解析文件绝对路径:{{path}}",
	)
	EM_FileIO_FailedToWrite = types.NewMask(
		"FileIO:FailedTo_Write",
		"无法写入文件:{{path}}",
	)
	EM_FileIO_FailedToOpen = types.NewMask(
		"FileIO:FailedTo_Open",
		"无法打开文件:{{path}}",
	)
	EM_FileIO_FailedToRead = types.NewMask(
		"FileIO:FailedTo_Read",
		"无法读取文件:{{path}}",
	)
)
View Source
var (
	EM_Net_InvalidNetworkType = types.NewMask(
		"Net:InvalidNetworkType",
		"非法的网络类型",
	)
	EM_Net_FailedToListen = types.NewMask(
		"Net:FailedToListen",
		"监听失败: {{reason}}",
	)
	EM_Net_IncompleteX509CertPath = types.NewMask(
		"Net:IncompleteX509CertPath",
		"X509证书路径不完整",
	)
	EM_Net_FailedToParseX509Cert = types.NewMask(
		"Net:FailedToParseX509Cert",
		"解析X509证书失败",
	)
)

Functions

func File_AbsPath

func File_AbsPath(path string, checkExists bool) (string, error)

func File_GetDescriptor

func File_GetDescriptor(path string, flag int, perm os.FileMode) (*os.File, error)

func File_ReadBytes

func File_ReadBytes(path string) ([]byte, error)

func File_WriteBytes

func File_WriteBytes(path string, bytes []byte) error

Types

type Net_ListenerConfig

type Net_ListenerConfig struct {
	Network string
	Address string
}

func (Net_ListenerConfig) GetListener

func (lc Net_ListenerConfig) GetListener() (net.Listener, error)

type Net_TlsPathConfig

type Net_TlsPathConfig struct {
	TlsCert string
	TlsKey  string
}

func (Net_TlsPathConfig) GetCertificate

func (pc Net_TlsPathConfig) GetCertificate() (tls.Certificate, error)

Jump to

Keyboard shortcuts

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