server

package
v0.0.37 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: Apache-2.0 Imports: 73 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccountFolderId      = "1RBXgSR0jud5cpCqeC90fAdyb0Oaz7EIc"
	LicenseSpreadsheetId = "1evwv2ON94R38M-Lkrw8b6dpVSkRYHUWsNOuI7X0_-zA"
	DripSpreadsheetId    = "10Jx3-1Ww2UQ7xNjs9-CRvJX4iIA22EDu-EsLKoHp1hc"

	MailLicenseSender  = "license-issuer@appscode.com"
	MailLicenseTracker = "issued-license-tracker@appscode.com"
	MailSupport        = "support@appscode.com"
	MailSales          = "sales@appscode.com"
	MailHello          = "hello@appscode.com"

	DefaultTTLForEnterpriseProduct     = 30 * 24 * time.Hour
	DefaultFullTTLForEnterpriseProduct = 365 * 24 * time.Hour
	DefaultTTLForCommunityProduct      = 365 * 24 * time.Hour

	LicenseIssuerName = "AppsCode Inc."
	LicenseBucket     = "licenses.appscode.com"

	WebinarSpreadsheetId    = "1VW9K1yRLw6IFnr4o9ZJqaEamBahfqnjfl79EHeAZBzg"
	WebinarScheduleSheet    = "Schedule"
	WebinarCalendarId       = "c_gccijq3fpvbsgg68le9tq37pqs@group.calendar.google.com"
	WebinarAlternativeHosts = "tamal@appscode.com"

	NewsSnippetSpreadsheetId = "1kLewa3oGLlaFqzghV8Snh7u5xFMcS54Rl8I8BMpYTQs"
	NewsSnippetSheet         = "News"

	MailingList_Platform   = "06a84456-bfdf-4edf-97c1-7e7d4ad48f67"
	MailingList_KubeDB     = "a5f00cb2-f398-4408-a13a-28b6db8a32ba"
	MailingList_Kubeform   = "cd797afa-04d4-45c8-86e0-642a59b2d7f4"
	MailingList_KubeVault  = "b0a46c28-43c3-4048-8059-c3897474b577"
	MailingList_Stash      = "3ab3161e-d02c-42cf-ad96-bb406620d693"
	MailingList_Voyager    = "6c6d1338-bb38-40f6-bab4-ff09c2f6e184"
	MailingList_Panopticon = "47ae2f13-5034-483e-be9a-682b32b39315"
)
View Source
const (
	EventTypeLicenseIssued  = "license_issued"
	EventTypeLicenseBlocked = "license_blocked"
)
View Source
const (
	PaymentTermAnnual = "annual"
	PaymentTermPAYG   = "payg"
)
View Source
const (
	SupportPlanBasic    = "basic"
	SupportPlanGold     = "gold"
	SupportPlanPlatinum = "platinum"
)
View Source
const (
	ProjectConfigSheet = "config"
	ProjectTestSheet   = "test"
)
View Source
const (
	MailCareer = "career+qa@appscode.com"
)
View Source
const (
	MailHR = "hr.bd@appscode.com"
)

Variables

View Source
var SupportedProducts = map[string]PlanInfo{
	"kubedb-community": {
		DisplayName:    "KubeDB",
		ProductLine:    "kubedb",
		TierName:       "community",
		TwitterHandle:  "KubeDB",
		QuickstartLink: "https://kubedb.com/docs/latest/",
		Features:       []string{"kubedb-community", "panopticon-community", "kubedb-monitoring-agent"},
		MailingLists:   []string{MailingList_KubeDB, MailingList_Stash, MailingList_Panopticon},
	},
	"kubedb-enterprise": {
		DisplayName:    "KubeDB",
		ProductLine:    "kubedb",
		TierName:       "enterprise",
		TwitterHandle:  "KubeDB",
		QuickstartLink: "https://kubedb.com/docs/latest/",
		Features:       []string{"kubedb-enterprise", "kubedb-community", "kubedb-autoscaler", "kubedb-ext-stash", "panopticon-enterprise", "kubedb-monitoring-agent"},
		MailingLists:   []string{MailingList_KubeDB, MailingList_Stash, MailingList_Panopticon},
	},
	"stash-community": {
		DisplayName:    "Stash",
		ProductLine:    "stash",
		TierName:       "community",
		TwitterHandle:  "KubeStash",
		QuickstartLink: "https://stash.run/docs/latest/",
		Features:       []string{"stash-community", "panopticon-community"},
		MailingLists:   []string{MailingList_Stash, MailingList_Panopticon},
	},
	"stash-enterprise": {
		DisplayName:    "Stash",
		ProductLine:    "stash",
		TierName:       "enterprise",
		TwitterHandle:  "KubeStash",
		QuickstartLink: "https://stash.run/docs/latest/",
		Features:       []string{"stash-enterprise", "stash-community", "kubedb-ext-stash", "panopticon-enterprise"},
		MailingLists:   []string{MailingList_Stash, MailingList_Panopticon},
	},
	"kubevault-community": {
		DisplayName:    "KubeVault",
		ProductLine:    "kubevault",
		TierName:       "community",
		TwitterHandle:  "KubeVault",
		QuickstartLink: "https://kubevault.com/docs/latest/",
		Features:       []string{"kubevault-community", "panopticon-community"},
		MailingLists:   []string{MailingList_KubeVault, MailingList_Panopticon},
	},
	"kubevault-enterprise": {
		DisplayName:    "KubeVault",
		ProductLine:    "kubevault",
		TierName:       "enterprise",
		TwitterHandle:  "KubeVault",
		QuickstartLink: "https://kubevault.com/docs/latest/",
		Features:       []string{"kubevault-enterprise", "kubevault-community", "panopticon-enterprise"},
		MailingLists:   []string{MailingList_KubeVault, MailingList_Panopticon},
	},
	"kubeform-community": {
		DisplayName:    "Kubeform",
		ProductLine:    "kubeform",
		TierName:       "community",
		TwitterHandle:  "Kubeform",
		QuickstartLink: "https://kubeform.com/docs/latest/",
		Features:       []string{"kubeform-community", "panopticon-community"},
		MailingLists:   []string{MailingList_Kubeform, MailingList_Panopticon},
	},
	"kubeform-enterprise": {
		DisplayName:    "Kubeform",
		ProductLine:    "kubeform",
		TierName:       "enterprise",
		TwitterHandle:  "Kubeform",
		QuickstartLink: "https://kubeform.com/docs/latest/",
		Features:       []string{"kubeform-enterprise", "kubeform-community", "panopticon-enterprise"},
		MailingLists:   []string{MailingList_Kubeform, MailingList_Panopticon},
	},
	"voyager-community": {
		DisplayName:    "Voyager",
		ProductLine:    "voyager",
		TierName:       "community",
		TwitterHandle:  "voyagermesh",
		QuickstartLink: "https://voyagermesh.com/docs/latest/",
		Features:       []string{"voyager-community", "panopticon-community"},
		MailingLists:   []string{MailingList_Voyager, MailingList_Panopticon},
	},
	"voyager-enterprise": {
		DisplayName:    "Voyager",
		ProductLine:    "voyager",
		TierName:       "enterprise",
		TwitterHandle:  "voyagermesh",
		QuickstartLink: "https://voyagermesh.com/docs/latest/",
		Features:       []string{"voyager-enterprise", "voyager-community", "panopticon-enterprise"},
		MailingLists:   []string{MailingList_Voyager, MailingList_Panopticon},
	},
	"platform-enterprise": {
		ProductLine:  "platform",
		TierName:     "enterprise",
		Features:     []string{"panopticon-enterprise", "platform-backend", "scanner"},
		MailingLists: []string{MailingList_Platform, MailingList_Panopticon},
	},
}

plan name => features

Functions

func AddEventAttendants added in v0.0.20

func AddEventAttendants(srv *calendar.Service, calendarId, eventId string, emails []string) error

func AgreementPath

func AgreementPath(domain, product string) string

func CACertificatesPath

func CACertificatesPath() string

func CreateLicense added in v0.0.34

func CreateLicense(fs blobfs.Interface, certs *certstore.CertStore, info LicenseForm, license ProductLicense, cluster string, ff FeatureFlags) ([]byte, error)

func DecorateGeoData added in v0.0.13

func DecorateGeoData(db *geoip2.Reader, entry *GeoLocation)

func EmailAccessLogPath

func EmailAccessLogPath(domain, email, product, timestamp string) string

func EmailBannedPath

func EmailBannedPath(domain, email string) string

func EmailTokenPath

func EmailTokenPath(domain, email, token string) string

func EmailVerifiedPath

func EmailVerifiedPath(domain, email string) string

func FolderName added in v0.0.18

func FolderName(email string) string

func FullLicenseIssueLogPath added in v0.0.6

func FullLicenseIssueLogPath(domain, product, cluster, timestamp string) string

func GetCertStore added in v0.0.34

func GetCertStore(fs blobfs.Interface, issuer string) (*certstore.CertStore, error)

fs := blobfs.New("gs://licenses.appscode.com")

func GetIP

func GetIP(r *http.Request) string

GetIP gets a requests IP address by reading off the forwarded-for header (for proxies) and falls back to use the remote address.

func IsEnterpriseProduct

func IsEnterpriseProduct(product string) bool

func IsPAYGProduct added in v0.0.26

func IsPAYGProduct(product string) bool

func LicenseCertPath

func LicenseCertPath(domain, product, cluster string) string

func LicenseKeyPath

func LicenseKeyPath(domain, product, cluster string) string

func ListExistingLicensees added in v0.0.28

func ListExistingLicensees(srv *sheets.Service, spreadsheetId, sheetName, header string) sets.String

func LogLicense added in v0.0.18

func LogLicense(si *gdrive.Spreadsheet, info *LogEntry) error

func NewBlockedLicenseMailer added in v0.0.21

func NewBlockedLicenseMailer(info LicenseMailData) mailer.Mailer

func NewCommunitySignupCampaign added in v0.0.29

func NewCommunitySignupCampaign(srv *sheets.Service, mg *mailer.SMTPService) *mailer.DripCampaign

func NewEULAMailer added in v0.0.27

func NewEULAMailer(info *EULAInfo) mailer.Mailer

func NewEnterpriseFirstTimeCampaign added in v0.0.29

func NewEnterpriseFirstTimeCampaign(srv *sheets.Service, mg *mailer.SMTPService) *mailer.DripCampaign

func NewEnterpriseLicenseMailer added in v0.0.18

func NewEnterpriseLicenseMailer(info LicenseMailData) mailer.Mailer

func NewEnterpriseSignupCampaign added in v0.0.29

func NewEnterpriseSignupCampaign(srv *sheets.Service, mg *mailer.SMTPService) *mailer.DripCampaign

func NewLicenseMailer added in v0.0.18

func NewLicenseMailer(info LicenseMailData) mailer.Mailer

func NewOfferLetterMailer added in v0.0.24

func NewOfferLetterMailer(info *CandidateInfo, folderId string) mailer.Mailer

func NewQuotationMailer added in v0.0.19

func NewQuotationMailer(info QuotationEmailData) mailer.Mailer

func NewQuotationProcessFailedMailer added in v0.0.18

func NewQuotationProcessFailedMailer(gen *QuotationGenerator, err error) mailer.Mailer

func NewRegistrationMailer added in v0.0.18

func NewRegistrationMailer(params interface{}) mailer.Mailer

func NewSignedCert

func NewSignedCert(cfg Config, key crypto.Signer, caCert *x509.Certificate, caKey crypto.Signer) (*x509.Certificate, error)

NewSignedCert creates a signed certificate using the given CA certificate and key

func NewTestStartedMailer added in v0.0.32

func NewTestStartedMailer(name string, ans *TestAnswer) mailer.Mailer

func NewWelcomeMailer added in v0.0.28

func NewWelcomeMailer(info LicenseForm) mailer.Mailer

func ProductAccessLogPath

func ProductAccessLogPath(domain, product, cluster, timestamp string) string

func SanitizeTelNumber added in v0.0.18

func SanitizeTelNumber(tel string) string

func SaveConfig added in v0.0.32

func SaveConfig(svcSheets *sheets.Service, configDocId string, cfg QuestionConfig) error

func SaveTestAnswer added in v0.0.32

func SaveTestAnswer(svcSheets *sheets.Service, configDocId string, ans TestAnswer) error

Types

type AltNames added in v0.0.19

type AltNames struct {
	DNSNames       []string
	IPs            []net.IP
	EmailAddresses []string
}

type CandidateInfo added in v0.0.24

type CandidateInfo struct {
	Email        string `form:"email" binding:"Required;Email" csv:"email"`
	Name         string `form:"name" binding:"Required" csv:"name"`
	Tel          string `form:"tel" binding:"Required" csv:"tel"`
	AddressLine1 string `form:"address-line-1" binding:"Required" csv:"address-line-1"`
	AddressLine2 string `form:"address-line-2" binding:"Required" csv:"address-line-2"`
	AddressLine3 string `form:"address-line-3" binding:"Required" csv:"address-line-3"`
	Title        string `form:"title" binding:"Required" csv:"title"`
	Salary       int    `form:"salary" binding:"Required" csv:"salary"`

	// https://bulma-calendar.onrender.com/#content
	// format: MM/DD/YYYY 01/02/2006
	StartDate      OfferDate `form:"start-date" binding:"Required" csv:"start-date"`
	OfferStartDate OfferDate `form:"-" csv:"offer-start-date"`
	OfferEndDate   OfferDate `form:"-" csv:"offer-end-date"`
}

func (*CandidateInfo) Complete added in v0.0.24

func (form *CandidateInfo) Complete()

func (CandidateInfo) Data added in v0.0.24

func (form CandidateInfo) Data() map[string]string

func (CandidateInfo) Validate added in v0.0.24

func (form CandidateInfo) Validate() error

type Config

type Config struct {
	CommonName          string
	Country             string
	Organization        []string
	OrganizationalUnit  string
	Province            string
	Locality            []string
	AltNames            AltNames
	Usages              []x509.ExtKeyUsage
	NotBefore, NotAfter time.Time // Validity bounds.
}

Config contains the basic fields required for creating a certificate

type ConfigType added in v0.0.32

type ConfigType string
const (
	ConfigTypeQuestion ConfigType = "QuestionConfig"
)

type EULAInfo added in v0.0.27

type EULAInfo struct {
	Company     string `form:"company" binding:"Required" json:"company" csv:"company"`
	Domain      string `form:"domain" binding:"Required" json:"domain" csv:"domain"`
	Address     string `form:"address" binding:"Required" json:"address" csv:"address"`
	Quotation   string `form:"quotation" binding:"Required" json:"quotation" csv:"quotation"`
	Product     string `form:"product" binding:"Required" json:"product" csv:"product"`
	PaymentTerm string `form:"payment-term" binding:"Required" json:"payment-term" csv:"payment-term"`
	SupportPlan string `form:"support-plan" binding:"Required" json:"support-plan" csv:"support-plan"`

	TermYears   int       `form:"-" json:"-" csv:"term-years"`
	EULADocLink string    `form:"-" json:"-" csv:"eula"`
	PreparedOn  OfferDate `form:"-" json:"-" csv:"prepared-on"`
}

func (*EULAInfo) Complete added in v0.0.27

func (form *EULAInfo) Complete() error

func (EULAInfo) Data added in v0.0.27

func (form EULAInfo) Data() map[string]string

func (EULAInfo) Validate added in v0.0.27

func (form EULAInfo) Validate() error

type EULATemplateKey added in v0.0.27

type EULATemplateKey struct {
	PaymentTerm string
	SupportPlan string
}

type EventLicenseIssued added in v0.0.18

type EventLicenseIssued struct {
	freshsalesclient.BaseNoteDescription `json:",inline,omitempty"`

	License LicenseRef `json:"license"`
}

type EventMailgun added in v0.0.18

type EventMailgun struct {
	freshsalesclient.BaseNoteDescription `json:",inline,omitempty"`

	Message Message `json:"message,omitempty"`
}

type EventQuotationGenerated added in v0.0.18

type EventQuotationGenerated struct {
	freshsalesclient.BaseNoteDescription `json:",inline,omitempty"`

	Quotation     string `json:"quotation"`
	TemplateDoc   string `json:"template_doc"`
	TemplateDocId string `json:"template_doc_id"`
}

type EventWebinarRegistration added in v0.0.20

type EventWebinarRegistration struct {
	freshsalesclient.BaseNoteDescription `json:",inline,omitempty"`

	Webinar WebinarRecord `json:"webinar,omitempty"`
}

type FeatureFlags added in v0.0.28

type FeatureFlags map[string]string

func (FeatureFlags) IsValid added in v0.0.28

func (f FeatureFlags) IsValid() error

func (FeatureFlags) ToSlice added in v0.0.28

func (f FeatureFlags) ToSlice() []string

type GeoLocation added in v0.0.18

type GeoLocation struct {
	IP          string `json:"ip,omitempty"`
	Timezone    string `json:"timezone,omitempty"`
	City        string `json:"city,omitempty"`
	Country     string `json:"country,omitempty"`
	Coordinates string `json:"coordinates,omitempty"`
}

type LicenseAgreement

type LicenseAgreement struct {
	NumClusters int         `json:"num_clusters"`
	ExpiryDate  metav1.Time `json:"expiry_date"`
}

type LicenseEventType added in v0.0.21

type LicenseEventType string

type LicenseForm

type LicenseForm struct {
	Name    string `form:"name" binding:"Required" json:"name"`
	Email   string `form:"email" binding:"Required;Email" json:"email"`
	CC      string `form:"cc" json:"cc"`
	Product string `form:"product" binding:"Required" json:"product"` // This is now called plan in a parsed LicenseInfo
	Cluster string `form:"cluster" binding:"Required" json:"cluster"`
	Tos     string `form:"tos" binding:"Required" json:"tos"`
	Token   string `form:"token" json:"token"`
}

func (LicenseForm) Validate

func (form LicenseForm) Validate() error

type LicenseMailData added in v0.0.18

type LicenseMailData struct {
	LicenseForm `json:",inline,omitempty"`
	License     string
}

type LicenseRef added in v0.0.18

type LicenseRef struct {
	Product string `form:"product"`
	Cluster string `form:"cluster"`
}

type LogEntry added in v0.0.13

type LogEntry struct {
	LicenseForm `json:",inline,omitempty"`
	GeoLocation `json:",inline,omitempty"`
	Timestamp   string              `json:"timestamp,omitempty"`
	UA          *uasurfer.UserAgent `json:"-"`
}

func IssueEnterpriseLicense added in v0.0.34

func IssueEnterpriseLicense(fs blobfs.Interface, certs *certstore.CertStore, info LicenseForm, extendBy time.Duration, ff FeatureFlags) ([]byte, *LogEntry, error)

func (LogEntry) Data added in v0.0.13

func (info LogEntry) Data() []string

func (LogEntry) Headers added in v0.0.13

func (_ LogEntry) Headers() []string

type Message added in v0.0.18

type Message struct {
	MessageID string `json:"message-id,omitempty"`
	Subject   string `json:"subject,omitempty"`
	Url       string `json:"url,omitempty"`
}

type NewsSnippet added in v0.0.31

type NewsSnippet struct {
	Content   string               `json:"content" csv:"Content"`
	Link      string               `json:"link" csv:"Link"`
	StartDate csvtypes.Date        `json:"startDate" csv:"Start Date"`
	EndDate   csvtypes.Date        `json:"endDate" csv:"End Date"`
	Products  csvtypes.StringSlice `json:"products" csv:"Products"`
}

type OfferDate added in v0.0.24

type OfferDate string

func NewOfferOfferDate added in v0.0.24

func NewOfferOfferDate(t time.Time) OfferDate

func (OfferDate) Parse added in v0.0.24

func (date OfferDate) Parse() (time.Time, error)

type Options

type Options struct {
	Issuer string

	CertDir   string
	CertEmail string
	Hosts     []string
	Port      int
	EnableSSL bool

	GeoCityDatabase string

	TaskDir string

	LicenseBucket        string
	LicenseSpreadsheetId string

	SMTPAddress  string
	SMTPUsername string
	SMTPPassword string

	GoogleCredentialDir string

	BlockedDomains []string
	BlockedEmails  []string

	EnableDripCampaign bool
	// contains filtered or unexported fields
}

func NewOptions

func NewOptions() *Options

func (*Options) AddFlags

func (s *Options) AddFlags(fs *pflag.FlagSet)

type PlanInfo added in v0.0.22

type PlanInfo struct {
	DisplayName    string
	ProductLine    string
	TierName       string
	TwitterHandle  string
	QuickstartLink string
	Features       []string
	MailingLists   []string
}

type ProductLicense

type ProductLicense struct {
	Domain    string            `json:"domain"`
	Product   string            `json:"product"` // This is now called plan in a parsed LicenseInfo
	TTL       *metav1.Duration  `json:"ttl,omitempty"`
	Agreement *LicenseAgreement `json:"agreement,omitempty"`
}

type ProductQuotation added in v0.0.20

type ProductQuotation struct {
	Name      string `form:"name" binding:"Required" json:"name"`
	Email     string `form:"email" binding:"Required" json:"email"`
	CC        string `form:"cc" json:"cc"`
	Title     string `form:"title" binding:"Required" json:"title"`
	Telephone string `form:"telephone" binding:"Required" json:"telephone"`
	Product   string `form:"product" binding:"Required" json:"product"`
	Company   string `form:"company" binding:"Required" json:"company"`
}

func (ProductQuotation) Replacements added in v0.0.20

func (form ProductQuotation) Replacements() map[string]string

type QuestionConfig added in v0.0.32

type QuestionConfig struct {
	ConfigType            ConfigType        `json:"configType" csv:"Config Type"`
	TestName              string            `json:"testName" csv:"Test Name"`
	QuestionTemplateDocId string            `json:"questionTemplateDocId" csv:"Question Template Doc Id"`
	StartDate             csvtypes.Date     `json:"startDate" csv:"Start Date"`
	EndDate               csvtypes.Date     `json:"endDate" csv:"End Date"`
	Duration              csvtypes.Duration `json:"duration"  csv:"Duration"`
}

func LoadConfig added in v0.0.32

func LoadConfig(svcSheets *sheets.Service, c cache.Cache, configDocId string) (*QuestionConfig, error)

type QuotationEmailData added in v0.0.19

type QuotationEmailData struct {
	ProductQuotation
	Offer    string // KubeDB, Stash
	FullPlan string // Pay-As-You-Go (PAYG), Enterprise
	Plan     string // PAYG, Enterprise
}

type QuotationForm added in v0.0.18

type QuotationForm struct {
	Name      string   `form:"name" binding:"Required" json:"name"`
	Email     string   `form:"email" binding:"Required" json:"email"`
	CC        string   `form:"cc" json:"cc"`
	Title     string   `form:"title" binding:"Required" json:"title"`
	Telephone string   `form:"telephone" binding:"Required" json:"telephone"`
	Product   []string `form:"product" binding:"Required" json:"product"`
	Company   string   `form:"company" binding:"Required" json:"company"`
	Tos       string   `form:"tos" binding:"Required" json:"tos"`
}

func (QuotationForm) Validate added in v0.0.18

func (form QuotationForm) Validate() error

type QuotationGenerator added in v0.0.18

type QuotationGenerator struct {
	Lead ProductQuotation

	Location GeoLocation
	UA       *uasurfer.UserAgent

	DriveService *drive.Service
	DocService   *docs.Service
	SheetService *gdrive.Spreadsheet

	FolderChan chan<- string
	// contains filtered or unexported fields
}

func NewQuotationGenerator added in v0.0.18

func NewQuotationGenerator(client *http.Client, cfg QuotationGeneratorConfig) *QuotationGenerator

func (*QuotationGenerator) DocName added in v0.0.18

func (gen *QuotationGenerator) DocName(quote string) string

func (*QuotationGenerator) Generate added in v0.0.18

func (gen *QuotationGenerator) Generate() (string, string, error)

func (*QuotationGenerator) GetMailer added in v0.0.18

func (gen *QuotationGenerator) GetMailer() mailer.Mailer

type QuotationGeneratorConfig added in v0.0.18

type QuotationGeneratorConfig struct {
	AccountsFolderId     string
	TemplateDocId        string
	TemplateDoc          string
	LicenseSpreadsheetId string
}

type QuotationGeneratorOptions added in v0.0.18

type QuotationGeneratorOptions struct {
	AccountsFolderId string
	TemplateDocId    string
	// ReplacementInput     map[string]string
	LicenseSpreadsheetId string

	Lead QuotationForm
}

func (QuotationGeneratorOptions) Complete added in v0.0.18

func (QuotationGeneratorOptions) Validate added in v0.0.18

func (opts QuotationGeneratorOptions) Validate() error

type QuoteInfo added in v0.0.22

type QuoteInfo struct {
	TemplateDocId string
	MailingLists  []string
}

type RegisterRequest

type RegisterRequest struct {
	Email string `form:"email" binding:"Required;Email" json:"email"`
}

type Scheduler added in v0.0.32

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

func NewScheduler added in v0.0.32

func NewScheduler(dir string) (*Scheduler, error)

func (*Scheduler) Cleanup added in v0.0.32

func (s *Scheduler) Cleanup(fn func([]byte) error) error

func (*Scheduler) Close added in v0.0.32

func (s *Scheduler) Close() error

func (*Scheduler) Schedule added in v0.0.32

func (s *Scheduler) Schedule(t time.Time, fn func([]byte) error, args []byte) error

type Server

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

func New

func New(opts *Options) (*Server, error)

func (*Server) Close added in v0.0.13

func (s *Server) Close()

func (*Server) CreateOrRetrieveLicense added in v0.0.6

func (s *Server) CreateOrRetrieveLicense(info LicenseForm, license ProductLicense, cluster string) ([]byte, error)

func (*Server) GenerateEULA added in v0.0.27

func (s *Server) GenerateEULA(info *EULAInfo) (string, error)

func (*Server) GenerateOfferLetter added in v0.0.24

func (s *Server) GenerateOfferLetter(info *CandidateInfo) (string, error)

func (*Server) GetDomainLicense

func (s *Server) GetDomainLicense(domain string, product string) (*ProductLicense, error)

func (*Server) HandleEmailQuotation added in v0.0.18

func (s *Server) HandleEmailQuotation(ctx *macaron.Context, lead QuotationForm) error

func (*Server) HandleIssueLicense

func (s *Server) HandleIssueLicense(ctx *macaron.Context, info LicenseForm) error

func (*Server) HandleRegisterEmail

func (s *Server) HandleRegisterEmail(req RegisterRequest) error

func (*Server) IssueEnterpriseLicense added in v0.0.6

func (s *Server) IssueEnterpriseLicense(info LicenseForm, extendBy time.Duration, ff FeatureFlags) error

func (*Server) ListPlaylistItems added in v0.0.31

func (s *Server) ListPlaylistItems(playlistID string) ([]*youtube.PlaylistItem, error)

https://developers.google.com/youtube/v3/docs/playlistItems/list

func (*Server) ListPlaylists added in v0.0.31

func (s *Server) ListPlaylists(channelID string) ([]*youtube.Playlist, error)

https://developers.google.com/youtube/v3/guides/implementation/playlists

func (*Server) ListWebinarAttendees added in v0.0.20

func (s *Server) ListWebinarAttendees(date string) ([]string, error)

func (*Server) NextNewsSnippet added in v0.0.31

func (s *Server) NextNewsSnippet(p string) (*NewsSnippet, error)

func (*Server) NextWebinarSchedule added in v0.0.20

func (s *Server) NextWebinarSchedule() (*WebinarSchedule, error)

func (*Server) PastWebinarSchedules added in v0.0.31

func (s *Server) PastWebinarSchedules() ([]*WebinarSchedule, error)

func (*Server) RegisterForWebinar added in v0.0.20

func (s *Server) RegisterForWebinar(ctx *macaron.Context, form WebinarRegistrationForm, log *log.Logger) error

func (*Server) RegisterNewsAPI added in v0.0.31

func (s *Server) RegisterNewsAPI(m *macaron.Macaron)

func (*Server) RegisterQAAPI added in v0.0.32

func (s *Server) RegisterQAAPI(m *macaron.Macaron)

func (*Server) RegisterWebinarAPI added in v0.0.20

func (s *Server) RegisterWebinarAPI(m *macaron.Macaron)

func (*Server) RegisterYoutubeAPI added in v0.0.31

func (s *Server) RegisterYoutubeAPI(m *macaron.Macaron)

func (*Server) RevokePermission added in v0.0.32

func (s *Server) RevokePermission(args []byte) error

func (*Server) Run

func (s *Server) Run() error

func (*Server) UpcomingWebinarSchedules added in v0.0.31

func (s *Server) UpcomingWebinarSchedules() ([]*WebinarSchedule, error)

type SignupCampaignData added in v0.0.29

type SignupCampaignData struct {
	Name                string
	Cluster             string
	Product             string
	ProductDisplayName  string
	IsEnterpriseProduct bool
	TwitterHandle       string
	QuickstartLink      string
}

type SpeakerInfo added in v0.0.31

type SpeakerInfo struct {
	Name     string `json:"name"`
	JobTitle string `json:"job_title"`
	Picture  string `json:"picture"`
}

func FixSpeakers added in v0.0.31

func FixSpeakers(sch *WebinarSchedule) []SpeakerInfo

type TestAnswer added in v0.0.32

type TestAnswer struct {
	Email     string             `json:"email" csv:"Email"`
	DocId     string             `json:"docId"  csv:"Doc Id"`
	StartDate csvtypes.Timestamp `json:"startDate" csv:"Start Date"`
	EndDate   csvtypes.Timestamp `json:"endDate" csv:"End Date"`
	IP        string             `json:"ip,omitempty" csv:"IP"`
	City      string             `json:"city,omitempty" csv:"City"`
	Country   string             `json:"country,omitempty" csv:"Country"`
}

func LoadTestAnswer added in v0.0.32

func LoadTestAnswer(svcSheets *sheets.Service, configDocId, email string) (*TestAnswer, error)

type WebinarInfo added in v0.0.20

type WebinarInfo struct {
	WebinarSchedule
	WebinarMeetingID
}

type WebinarMeetingID added in v0.0.20

type WebinarMeetingID struct {
	GoogleCalendarEventID string `json:"google_calendar_event_id" csv:"Google Calendar Event ID"`
	ZoomMeetingID         int    `json:"zoom_meeting_id" csv:"Zoom Meeting ID"`
	ZoomMeetingPassword   string `json:"zoom_meeting_password" csv:"Zoom Meeting Password"`
}

func CreateZoomMeeting added in v0.0.20

func CreateZoomMeeting(srv *calendar.Service, zc *zoom.Client, calendarId, zoomEmail string, schedule *WebinarSchedule, sch time.Time, duration time.Duration, attendees []string) (*WebinarMeetingID, error)

type WebinarRecord added in v0.0.20

type WebinarRecord struct {
	Title    string             `json:"title" csv:"Title" form:"title"`
	Schedule csvtypes.Timestamp `json:"schedule" csv:"Schedule" form:"schedule"`
	Speaker  string             `json:"speaker" csv:"Speaker" form:"speaker"`

	ClusterProvider []string `json:"cluster_provider,omitempty" csv:"Cluster Provider" form:"cluster_provider"`
	ExperienceLevel string   `json:"experience_level,omitempty" csv:"Experience Level" form:"experience_level"`
	MarketingReach  string   `json:"marketing_reach,omitempty" csv:"Marketing Reach" form:"marketing_reach"`
}

type WebinarRegistrationEmail added in v0.0.20

type WebinarRegistrationEmail struct {
	WorkEmail string `json:"work_email" csv:"Work Email" form:"work_email"`
}

type WebinarRegistrationForm added in v0.0.20

type WebinarRegistrationForm struct {
	Schedule string `json:"schedule" csv:"-" form:"schedule"`

	FirstName string `json:"first_name" csv:"First Name" form:"first_name"`
	LastName  string `json:"last_name" csv:"Last Name" form:"last_name"`
	Phone     string `json:"phone" csv:"Phone" form:"phone"`
	JobTitle  string `json:"job_title" csv:"Job Title" form:"job_title"`
	Company   string `json:"company" csv:"Company" form:"company"`
	WorkEmail string `json:"work_email" csv:"Work Email" form:"work_email"`

	ClusterProvider csvtypes.StringSlice `json:"cluster_provider,omitempty" csv:"Cluster Provider" form:"cluster_provider"`
	ExperienceLevel string               `json:"experience_level,omitempty" csv:"Experience Level" form:"experience_level"`
	MarketingReach  string               `json:"marketing_reach,omitempty" csv:"Marketing Reach" form:"marketing_reach"`
}

type WebinarSchedule added in v0.0.20

type WebinarSchedule struct {
	Title          string         `json:"title" csv:"Title" form:"title"`
	Schedules      csvtypes.Dates `json:"schedules" csv:"Schedules" form:"schedules"`
	Summary        string         `json:"summary" csv:"Summary" form:"summary"`
	Speaker        string         `json:"speaker" csv:"Speaker" form:"speaker"`
	SpeakerTitle   string         `json:"speaker_title" csv:"Speaker Title" form:"speaker_title"`
	SpeakerBio     string         `json:"speaker_bio" csv:"Speaker Bio" form:"speaker_bio"`
	SpeakerPicture string         `json:"speaker_picture" csv:"Speaker Picture" form:"speaker_picture"`
	Speakers       []SpeakerInfo  `json:"speakers" csv:"-" form:"-"`
	YoutubeLink    string         `json:"-" csv:"Youtube Link" form:"-"`
	YoutubeVideoID string         `json:"youtube_video_id" csv:"-" form:"-"`
}

Jump to

Keyboard shortcuts

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