config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SPEEDFS_PATH_ENV     = "SPEEDFS_PATH"
	SPEEDFS_PATH_DEFAULT = "~/.speedfs"
	FILE_DIR_NAME        = "file"
	CONF_DIR_NAME        = "config"
	CONF_FILE_NAME       = "config.json"
	LOG_DIR_NAME         = "log"
	PID_FILE_NAME        = "speedfs.pid"
	DEFAULT_SERVER_PORT  = 9999
)

Variables

View Source
var (
	BUILD_TIME string
	GIT_COMMIT string
	GO_VERSION string
)
View Source
var (
	SPEEDFS_PATH  string
	GloableConfig Config
)

Functions

func ConfDir

func ConfDir() string

func ConfFilePath

func ConfFilePath() string

func GlobalLogger

func GlobalLogger() *logrus.Logger

func LoadGlobalConfig

func LoadGlobalConfig() error

func LogDir

func LogDir() string

func OtherPeers

func OtherPeers() []string

func PidFilePath

func PidFilePath() string

func PrintSysteminfo

func PrintSysteminfo()

func SelfPeer

func SelfPeer() string

func SpeedfsPath

func SpeedfsPath() string

Types

type Config

type Config struct {
	Port        int      `json:"port"`
	AdvertiseIP string   `json:"advertise-ip"`
	Peers       []string `json:"peers"`
}

Jump to

Keyboard shortcuts

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