now

package module
v0.0.0-...-227ddbc Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2019 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	BaseEndpoint         = "https://api.zeit.co"
	RequestLoginEndpoint = BaseEndpoint + "/now/registration"
	VerifyLoginEndpoint  = RequestLoginEndpoint + "/verify?email=%s&token=%s"
)

Base consts

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	URL        *url.URL
	HTTPClient *http.Client
	Config     ClientConfig
}

Client struct

func NewClient

func NewClient(config ClientConfig) (*Client, error)

NewClient creates a new client to interact with the Zeit API

func (*Client) FetchAuthToken

func (c *Client) FetchAuthToken(authEmail string, authTokenName string) (string, error)

FetchAuthToken gets a new auth token

type ClientConfig

type ClientConfig struct {
	Endpoint string
	Token    string
}

ClientConfig struct

func NewConfig

func NewConfig(token string) *ClientConfig

NewConfig creates a new ClientConfig with token as its Token

func NewEmptyTokenConfig

func NewEmptyTokenConfig() *ClientConfig

NewEmptyTokenConfig creates a new ClientConfig with an empty Token

Jump to

Keyboard shortcuts

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