config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SessionVal    string
	IP            string
	Port          int
	RootPath      string
	IsAllowUpload bool
	MaxLevel      uint
	IsSecure      bool
	Output        io.Writer
)

Functions

func PrintAddr

func PrintAddr(c *Config)

func PrintAllow

func PrintAllow(c *Config)

Print Allow upload Status

func PrintLevel

func PrintLevel(c *Config)

Print Max allow access level

func PrintPath

func PrintPath(c *Config)

Print RootPath infomation

func PrintSecure

func PrintSecure(c *Config)

Print Secure status

Types

type Config

type Config struct {
	SessionVal    string
	IP            string
	Port          int
	RootPath      string
	IsAllowUpload bool
	MaxLevel      uint
	IsSecure      bool
	Output        io.Writer
}

func NewConfig

func NewConfig(ip string, port int, path string, opt ...Opt) *Config

func (*Config) PrintInfo

func (c *Config) PrintInfo(opt ...PrintOpt)

PrintInfo 会在程序启动后打印本机 IP、共享目录、是否允许上传的信息

type Opt

type Opt func(c *Config)

func OptIsAllowUpload

func OptIsAllowUpload(IsAllowUpload bool) Opt

func OptIsSecure

func OptIsSecure(isSecure bool) Opt

func OptMaxLevel

func OptMaxLevel(maxLevel uint) Opt

func OptOutput

func OptOutput(output io.Writer) Opt

func OptRootPath

func OptRootPath(rootPath string) Opt

type PrintOpt

type PrintOpt func(c *Config)

func PrintAll

func PrintAll() []PrintOpt

Jump to

Keyboard shortcuts

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