utils

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CLEAR_LINE = "\r\u001b[K"

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 Cfprintf added in v0.0.6

func Cfprintf(w io.Writer, format string, a ...any)

/ ClearLine fprintf

func ConfAddAccount

func ConfAddAccount(email, token string) error

func ConfDelAccount added in v0.0.6

func ConfDelAccount(email 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