service

package
v0.0.0-...-d212e06 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KB = uint64(math.Pow(2, 10))
	MB = uint64(math.Pow(2, 20))
	GB = uint64(math.Pow(2, 30))
	TB = uint64(math.Pow(2, 40))
)

Functions

func BytesToGB

func BytesToGB(b uint64) float64

func BytesToKB

func BytesToKB(b uint64) float64

func BytesToMB

func BytesToMB(b uint64) float64

func BytesToTB

func BytesToTB(b uint64) float64

func CelsiusToFahrenheit

func CelsiusToFahrenheit(c int) int

func ConvertBytes

func ConvertBytes(b uint64) (float64, string)

func ConvertBytesString

func ConvertBytesString(b uint64) string

func CopyFile

func CopyFile(src, dest string) (written int64, err error)

func GenToken

func GenToken(l int) string

func InitLogger

func InitLogger(basePath string, fileName string) *log.Logger

func Launch

func Launch()

func Must

func Must(i interface{}, err error) interface{}

func Stop

func Stop()

func WarpHandle

func WarpHandle(fn interface{}) gin.HandlerFunc

func WriteFile

func WriteFile(filename string, reader io.Reader) (written int64, err error)

Types

type Config

type Config struct {
	WebAddr          string `toml:"WebAddr"`
	WebIndex         string `toml:"WebIndex"`
	StaticFS         bool   `json:"staticFS"`
	FilePath         string `toml:"FilePath"`
	FileDiskTotal    uint64 `toml:"FileDiskTotal"`
	SaveFileMultiple bool   `toml:"SaveFileMultiple"`
	Username         string `toml:"Username"`
	Password         string `toml:"Password"`
}

func LoadConfig

func LoadConfig(path string) *Config

type Result

type Result struct {
	Success bool        `json:"success"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

应答结构

type WaitConn

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

func (*WaitConn) Context

func (this *WaitConn) Context() *gin.Context

func (*WaitConn) Done

func (this *WaitConn) Done(code ...int)

func (*WaitConn) GetRoute

func (this *WaitConn) GetRoute() string

func (*WaitConn) SetResult

func (this *WaitConn) SetResult(message string, data interface{})

func (*WaitConn) Wait

func (this *WaitConn) Wait()

Jump to

Keyboard shortcuts

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