Documentation
¶
Index ¶
- Constants
- Variables
- func AbortVanityBuild(m shared.MetaContext, user *User, vhr *VHostRow) error
- func CheckCSRFToken(m shared.MetaContext, uid proto.UID, tok CSRFToken) error
- func CheckVanityHost(m shared.MetaContext, user *User, vhr *VHostRow) error
- func GetSessionCookie(m shared.MetaContext, r *http.Request) (*rem.WebSession, error)
- func HandleErr(w http.ResponseWriter, r *http.Request, err error)
- func MakeCannedVHost(m shared.MetaContext, host proto.Hostname, domain proto.Hostname) error
- func NewBadParamError(id string) error
- func NewMissingParamError(id string) error
- func Pluralize(s string, n int) string
- func RandomMultiUseInviteCode() (*rem.MultiUseInviteCode, error)
- func SetSessionCookie(m shared.MetaContext, w http.ResponseWriter, ws rem.WebSession) error
- type ActionType
- type AdminPageData
- func (a *AdminPageData) CanAddMoreVHosts() bool
- func (a *AdminPageData) CanDoSSO() bool
- func (d *AdminPageData) GetCSRFToken() *CSRFToken
- func (d *AdminPageData) GetHead() *HeaderData
- func (d *AdminPageData) LoadUsageData(m shared.MetaContext) error
- func (d *AdminPageData) LoadVHosts(m shared.MetaContext) error
- type Args
- func (a *Args) ActionType(src ParamSource, id string) (ActionType, error)
- func (a *Args) Hostname(src ParamSource, id string) (proto.Hostname, error)
- func (a *Args) HostnamePart(src ParamSource, id string) (proto.Hostname, error)
- func (a *Args) IsChecked(src ParamSource, id string) (bool, error)
- func (a *Args) MultiUseInviteCode(src ParamSource, id string) (*rem.MultiUseInviteCode, error)
- func (a *Args) NonApexHostname(src ParamSource, id string) (proto.Hostname, error)
- func (a *Args) OAuth2SessionID(src ParamSource, id string) (*proto.OAuth2SessionID, error)
- func (a *Args) PlanID(src ParamSource, id string) (*proto.PlanID, error)
- func (a *Args) PriceID(src ParamSource, id string) (*proto.PriceID, error)
- func (a *Args) SSOConfig(src ParamSource, providerParam string, urlParam string, idParam string, ...) (*proto.SSOConfig, error)
- func (a *Args) StdTargetHostID() (*proto.HostID, error)
- func (a *Args) String(src ParamSource, id string) (string, error)
- func (a *Args) StripePriceID(src ParamSource, id string) (*infra.StripePriceID, error)
- func (a *Args) StripeSessionID(src ParamSource, id string) (infra.StripeSessionID, error)
- func (a *Args) StripeSubscriptionID(src ParamSource, id string) (infra.StripeSubscriptionID, error)
- func (a *Args) TeamID(src ParamSource, id string) (*proto.TeamID, error)
- func (a *Args) Time(src ParamSource, id string) (*proto.Time, error)
- func (a *Args) VHostID(src ParamSource, id string) (*proto.VHostID, error)
- func (a *Args) ViewershipMode(src ParamSource, id string) (proto.ViewershipMode, error)
- type BaseHandler
- type CSRFToken
- type DataLoadOpts
- type ErrHandler
- type FindRowRes
- type HeaderData
- type Host
- type NoncePackage
- type OAuth2PageData
- type PageDataer
- type PageSelector
- type PageType
- type ParamSource
- type Plan
- type ProrationData
- type RedirectError
- type TypedAdminPageMain
- type UsageData
- type UsageRow
- type UsageSummary
- type User
- func (u *User) CheckIsAdminOf(m shared.MetaContext, hid proto.HostID) (*core.HostID, error)
- func (u *User) Email(m shared.MetaContext) (proto.Email, error)
- func (u *User) LoadOrCreateCustomerID(m shared.MetaContext) (infra.StripeCustomerID, error)
- func (u *User) StripeCustomerID(m shared.MetaContext) (infra.StripeCustomerID, error)
- func (u *User) ToUHC() shared.UserHostContext
- type VHostAddArgs
- type VHostCheckError
- type VHostData
- type VHostRow
- type VHostRowDetails
- func (r *VHostRowDetails) FindMultiUseInviteCode(c rem.MultiUseInviteCode) *shared.MultiUseInviteCode
- func (d *VHostRowDetails) HasOAuth2SSO() bool
- func (d *VHostRowDetails) IsGoogleSSO() bool
- func (d *VHostRowDetails) OAuth2SSOClientID() string
- func (d *VHostRowDetails) OAuth2SSOClientSecret() string
- func (d *VHostRowDetails) OAuth2SSOConfigURL() string
- func (d *VHostRowDetails) OAuth2SSORedirectURI() proto.URLString
- type VHostSetupError
- type VHostUsage
- type ViewershipMode
Constants ¶
View Source
const GoogleOIDCConfigURL = "https://accounts.google.com/.well-known/openid-configuration"
Variables ¶
View Source
var ValidUserViewershipModes = []ViewershipMode{ {proto.ViewershipMode_Open, "open"}, {proto.ViewershipMode_Closed, "closed"}, }
Functions ¶
func AbortVanityBuild ¶
func AbortVanityBuild( m shared.MetaContext, user *User, vhr *VHostRow, ) error
func CheckCSRFToken ¶
func CheckVanityHost ¶
func CheckVanityHost( m shared.MetaContext, user *User, vhr *VHostRow, ) error
func GetSessionCookie ¶
func GetSessionCookie( m shared.MetaContext, r *http.Request, ) ( *rem.WebSession, error, )
func MakeCannedVHost ¶
func NewBadParamError ¶
func NewMissingParamError ¶
func RandomMultiUseInviteCode ¶
func RandomMultiUseInviteCode() (*rem.MultiUseInviteCode, error)
func SetSessionCookie ¶
func SetSessionCookie( m shared.MetaContext, w http.ResponseWriter, ws rem.WebSession, ) error
Types ¶
type ActionType ¶
type ActionType int
const ( ActionTypeApprove ActionType = 1 ActionTypeCancel ActionType = 2 )
type AdminPageData ¶
type AdminPageData struct {
User *User
Which PageSelector
// Can be nil or zero-valied dedpending on how the data is loaded
HostConfig *proto.HostConfig
Usage *UsageData
AllPlans []Plan
ActiveSess infra.StripeSessionID
Head *HeaderData
Invoices *shared.StripeInvoices
VHosts *VHostData
UserPlan *infra.UserPlan
}
func LoadAdminPageData ¶
func LoadAdminPageData( m shared.MetaContext, u *User, opts DataLoadOpts, ) ( *AdminPageData, error, )
func (*AdminPageData) CanAddMoreVHosts ¶
func (a *AdminPageData) CanAddMoreVHosts() bool
func (*AdminPageData) CanDoSSO ¶
func (a *AdminPageData) CanDoSSO() bool
func (*AdminPageData) GetCSRFToken ¶
func (d *AdminPageData) GetCSRFToken() *CSRFToken
func (*AdminPageData) GetHead ¶
func (d *AdminPageData) GetHead() *HeaderData
func (*AdminPageData) LoadUsageData ¶
func (d *AdminPageData) LoadUsageData(m shared.MetaContext) error
func (*AdminPageData) LoadVHosts ¶
func (d *AdminPageData) LoadVHosts( m shared.MetaContext, ) error
type Args ¶
type Args struct {
// contains filtered or unexported fields
}
func (*Args) ActionType ¶
func (a *Args) ActionType(src ParamSource, id string) (ActionType, error)
func (*Args) HostnamePart ¶
func (*Args) MultiUseInviteCode ¶
func (a *Args) MultiUseInviteCode(src ParamSource, id string) (*rem.MultiUseInviteCode, error)
func (*Args) NonApexHostname ¶
func (*Args) OAuth2SessionID ¶
func (a *Args) OAuth2SessionID(src ParamSource, id string) (*proto.OAuth2SessionID, error)
func (*Args) StripePriceID ¶
func (a *Args) StripePriceID(src ParamSource, id string) (*infra.StripePriceID, error)
func (*Args) StripeSessionID ¶
func (a *Args) StripeSessionID(src ParamSource, id string) (infra.StripeSessionID, error)
func (*Args) StripeSubscriptionID ¶
func (a *Args) StripeSubscriptionID(src ParamSource, id string) (infra.StripeSubscriptionID, error)
func (*Args) ViewershipMode ¶
func (a *Args) ViewershipMode(src ParamSource, id string) (proto.ViewershipMode, error)
type BaseHandler ¶
type BaseHandler struct {
// contains filtered or unexported fields
}
func NewBaseHandler ¶
func NewBaseHandler(g *shared.GlobalContext) *BaseHandler
func NewBaseHandlerWithErr ¶
func NewBaseHandlerWithErr(g *shared.GlobalContext, eh ErrHandler) *BaseHandler
func (*BaseHandler) Serve ¶
func (b *BaseHandler) Serve( w http.ResponseWriter, r *http.Request, h func(m shared.MetaContext) error, )
func (*BaseHandler) ServeWithVHost ¶
func (b *BaseHandler) ServeWithVHost( w http.ResponseWriter, r *http.Request, h func(m shared.MetaContext) error, )
type DataLoadOpts ¶
type ErrHandler ¶
type ErrHandler func(w http.ResponseWriter, r *http.Request, err error)
type FindRowRes ¶
type FindRowRes struct {
Row UsageRow
Prev proto.EntityIDString
Mine bool
}
type HeaderData ¶
type HeaderData struct {
Title string
Nonce NoncePackage
}
func NewHeaderData ¶
func NewHeaderData(ctx context.Context, t string) *HeaderData
type Host ¶
func LoadHostByShortID ¶
func LoadHostByShortID( m shared.MetaContext, shid core.ShortHostID, ) ( *Host, error, )
type NoncePackage ¶
func NewNoncePackage ¶
func NewNoncePackage() (*NoncePackage, error)
func NoncePkgFromContext ¶
func NoncePkgFromContext(ctx context.Context) *NoncePackage
type OAuth2PageData ¶
type OAuth2PageData struct {
Head *HeaderData
}
func LoadOAuth2PageData ¶
func LoadOAuth2PageData( m shared.MetaContext, opts DataLoadOpts, ) ( *OAuth2PageData, error, )
func (*OAuth2PageData) GetCSRFToken ¶
func (d *OAuth2PageData) GetCSRFToken() *CSRFToken
func (*OAuth2PageData) GetHead ¶
func (d *OAuth2PageData) GetHead() *HeaderData
type PageDataer ¶
type PageDataer interface {
GetHead() *HeaderData
GetCSRFToken() *CSRFToken
}
type PageSelector ¶
type ParamSource ¶
type ParamSource int
const ( ParamSourceURL ParamSource = 1 ParamSourceForm ParamSource = 2 ParamSourceQuery ParamSource = 3 )
type Plan ¶
func DecoratePlans ¶
type ProrationData ¶
type ProrationData struct {
}
type RedirectError ¶
func (RedirectError) Error ¶
func (r RedirectError) Error() string
type TypedAdminPageMain ¶
type UsageData ¶
type UsageData struct {
Mine []UsageRow
Others []UsageRow
UserPlan *infra.UserPlan
QCfg infra.QuotaConfig
Summary UsageSummary
}
func LoadUsageData ¶
func (*UsageData) CanAddMoreTeams ¶
type User ¶
type User struct {
Uid proto.UID
Name proto.NameUtf8
Host *Host
CSRFToken CSRFToken
AdminOfHost *core.HostID
}
func LoadUserBySession ¶
func LoadUserBySession( m shared.MetaContext, sess rem.WebSession, ) ( *User, error, )
func LoadUserFromCookie ¶
func (*User) CheckIsAdminOf ¶
func (*User) LoadOrCreateCustomerID ¶
func (u *User) LoadOrCreateCustomerID(m shared.MetaContext) (infra.StripeCustomerID, error)
func (*User) StripeCustomerID ¶
func (u *User) StripeCustomerID(m shared.MetaContext) (infra.StripeCustomerID, error)
func (*User) ToUHC ¶
func (u *User) ToUHC() shared.UserHostContext
type VHostAddArgs ¶
type VHostAddArgs struct {
IsBYOD bool // can toggle on or off
Err *VHostSetupError
}
type VHostCheckError ¶
type VHostCheckError struct {
Err error
}
func (VHostCheckError) Error ¶
func (e VHostCheckError) Error() string
type VHostData ¶
func LoadVHostData ¶
func LoadVHostData( m shared.MetaContext, ) (*VHostData, error)
func (*VHostData) TotalDiskUsage ¶
func (*VHostData) TotalUsers ¶
type VHostRow ¶
type VHostRow struct {
Id core.HostID // might be =0 if not yet complete
VHostID proto.VHostID
Name proto.Hostname
Usage VHostUsage
IsClaimed bool
IsClaimedByMe bool
IsCanned bool
Stem proto.Hostname // If a vanity host, the CNAME stem
Stage proto.HostBuildStage
Details *VHostRowDetails
}
func (*VHostRow) LoadDetails ¶
func (r *VHostRow) LoadDetails(m shared.MetaContext) error
type VHostRowDetails ¶
type VHostRowDetails struct {
MultiUseInvites []shared.MultiUseInviteCode
Config proto.HostConfig
SSO *proto.SSOConfig
OAuth2CallbackURL proto.URLString // this is known regardless of SSO configuration
}
func (*VHostRowDetails) FindMultiUseInviteCode ¶
func (r *VHostRowDetails) FindMultiUseInviteCode(c rem.MultiUseInviteCode) *shared.MultiUseInviteCode
func (*VHostRowDetails) HasOAuth2SSO ¶
func (d *VHostRowDetails) HasOAuth2SSO() bool
func (*VHostRowDetails) IsGoogleSSO ¶ added in v0.1.8
func (d *VHostRowDetails) IsGoogleSSO() bool
func (*VHostRowDetails) OAuth2SSOClientID ¶
func (d *VHostRowDetails) OAuth2SSOClientID() string
func (*VHostRowDetails) OAuth2SSOClientSecret ¶
func (d *VHostRowDetails) OAuth2SSOClientSecret() string
func (*VHostRowDetails) OAuth2SSOConfigURL ¶
func (d *VHostRowDetails) OAuth2SSOConfigURL() string
func (*VHostRowDetails) OAuth2SSORedirectURI ¶
func (d *VHostRowDetails) OAuth2SSORedirectURI() proto.URLString
type VHostSetupError ¶
type VHostSetupError struct {
Err error
}
func (VHostSetupError) Error ¶
func (e VHostSetupError) Error() string
type VHostUsage ¶
func (VHostUsage) IsEmpty ¶
func (v VHostUsage) IsEmpty() bool
type ViewershipMode ¶
type ViewershipMode struct {
proto.ViewershipMode
Desc string
}
Click to show internal directories.
Click to hide internal directories.