utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigExist

func ConfigExist(configPath string) bool

func Home

func Home() string

Home returns the home directory for the executing user.

This uses an OS-specific method for discovering the home directory. An error is returned if a home directory cannot be detected.

func ReplaceConfig

func ReplaceConfig(fileName string, conf ConfigParam) (bool, error)

Types

type ConfigParam

type ConfigParam struct {
	Port int64  `json:"port"`
	Host string `json:"host"`
	Key  string `json:"key"`
}

func LoadConfig

func LoadConfig(filepath string) (ConfigParam, error)

type ResponseMessage

type ResponseMessage struct {
	Code    int64  `json:"code"`
	Data    string `json:"data"`
	Message string `json:"message"`
}

func Get

func Get(url string) (ResponseMessage, error)

Get request

func Post

func Post(url string, data *url.Values) (ResponseMessage, error)

Post request

Jump to

Keyboard shortcuts

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