console

package
v0.0.0-...-7e7fb06 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2017 License: Apache-2.0 Imports: 28 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	EventNewSubscriber = "NewSubscriber"
	EventFirstLogin    = "FirstLogin"
)
View Source
const (
	MaxPendingInvites = 5
)

Variables

This section is empty.

Functions

func GenerateInviteCode

func GenerateInviteCode(user *User) (string, error)

func RegisterUser

func RegisterUser(user *User) error

Types

type Account

type Account struct {
	CustomerID     string `mapstructure:"customer_id"`
	SubscriptionID string `mapstructure:"subscription_id"`
	Plan           string
}

type AppMetadata

type AppMetadata struct {
	Account `mapstructure:",squash"`
	Groups  map[string]Account
	Invites Invites
}

type BillingInfo

type BillingInfo struct {
	Plan         string
	Email        string
	Period       string
	NextPayment  time.Time
	NextAmount   string
	CardType     string
	CardLastFour string
	CardExpMonth uint8
	CardExpYear  uint16
	History      []BillingInvoice
}

func GetBillingInfo

func GetBillingInfo(user *User) (BillingInfo, error)

type BillingInvoice

type BillingInvoice struct {
	Paid         bool
	Date         time.Time
	Amount       string
	Description  string
	CardType     string
	CardLastFour string
}

type Component

type Component struct {
}

func (*Component) MatchHTTP

func (c *Component) MatchHTTP(r *http.Request) bool

func (*Component) PreprocessOrder

func (c *Component) PreprocessOrder() uint

func (*Component) PreprocessSession

func (c *Component) PreprocessSession(sess ssh.Session) (cont bool, msg string)

func (*Component) ServeHTTP

func (c *Component) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Component) StripeEvents

func (c *Component) StripeEvents() []string

func (*Component) StripeReceive

func (c *Component) StripeReceive(event stripe.Event)

func (*Component) WebAuthLogin

func (c *Component) WebAuthLogin(w http.ResponseWriter, r *http.Request, token *oauth2.Token) error

func (*Component) WebAuthLogout

func (c *Component) WebAuthLogout(w http.ResponseWriter, r *http.Request) error

func (*Component) WebTemplateFuncMap

func (c *Component) WebTemplateFuncMap(r *http.Request) template.FuncMap

type Invites

type Invites struct {
	Pending   []string
	InvitedBy string `mapstructure:"invited_by"`
}

type User

type User struct {
	Name     string
	Nickname string
	Email    string
	Picture  string
	Account  AppMetadata `mapstructure:"app_metadata"`
	ID       string      `mapstructure:"user_id"`
}

func ContextUser

func ContextUser(ctx context.Context) *User

func InviteCodeUser

func InviteCodeUser(code string) (*User, error)

func LookupNickname

func LookupNickname(nickname string) (User, error)

func LookupUser

func LookupUser(uid string) (User, error)

func SessionUser

func SessionUser(r *http.Request) *User

Jump to

Keyboard shortcuts

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