surge

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Surge

type Surge struct {
	// contains filtered or unexported fields
}

func New

func New() *Surge

new a Surge instance with default http client and automatically load email&token from `~/.netrc` if there is still no token, please call `surge.Login()` to login

func (*Surge) Account

func (surge *Surge) Account() (types.Account, error)

func (*Surge) GetEmailAndToken

func (surge *Surge) GetEmailAndToken() (string, string)

func (*Surge) List

func (surge *Surge) List() (types.List, error)

func (*Surge) Login

func (surge *Surge) Login(username, password string) (email string, err error)

login and store email&token to `~/.netrc` just like what the official surge cli do if the username do not exists, surge.sh will create one for you :)

func (*Surge) Logout

func (surge *Surge) Logout() (email string, err error)

logout and clear the `~/.netrc`

func (*Surge) SetEmailAndToken

func (surge *Surge) SetEmailAndToken(email, token string)

func (*Surge) SetHTTPClient

func (surge *Surge) SetHTTPClient(client *http.Client)

change the default http client

func (*Surge) Teardown

func (surge *Surge) Teardown(domain string) (types.Teardown, error)

func (*Surge) Upload

func (surge *Surge) Upload(domain, src string, onEventStream func(byteLine []byte)) error

func (*Surge) Whoami

func (surge *Surge) Whoami() string

Jump to

Keyboard shortcuts

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