utils

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfPath string

Functions

func AtHome

func AtHome(elem ...string) string

given a path, return a file path in HOME directory

func ClearLine

func ClearLine()

func ClearLineStderr added in v0.0.5

func ClearLineStderr()

func ConfAddAccount

func ConfAddAccount(email, token string) error

func ConfGetApi

func ConfGetApi() string

func ConfGetEmailList

func ConfGetEmailList() []string

func ConfSetApi

func ConfSetApi(api string) error

func ConfUseEmail

func ConfUseEmail(email string) error

func FormatBytes

func FormatBytes(bytes int64) string

func GetHome

func GetHome() string

func IsDir

func IsDir(f string) bool

func IsFileExist

func IsFileExist(path string) bool

func JSONStringify added in v0.0.5

func JSONStringify(v any) string

func ReadNetrc

func ReadNetrc() (login, password string, err error)

func ReadTextFile added in v0.0.5

func ReadTextFile(name string) (string, error)

func ReadTextFileTrim added in v0.0.5

func ReadTextFileTrim(name string) (string, error)

func RemoveNetrc

func RemoveNetrc() error

func WriteNetrc

func WriteNetrc(login, password string) error

Types

type RoundTrip

type RoundTrip func(req *http.Request) (*http.Response, error)

func (RoundTrip) RoundTrip

func (rt RoundTrip) RoundTrip(req *http.Request) (*http.Response, error)

type SurgeCliConf

type SurgeCliConf struct {
	Api      string            `json:"api"`
	Accounts map[string]string `json:"accounts"`
}

Jump to

Keyboard shortcuts

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