server

package
v0.0.66 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: Apache-2.0 Imports: 74 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 PaidFeatures = sets.NewString(
	"config-syncer-enterprise",
	"kubedb-autoscaler",
	"kubedb-enterprise",
	"kubedb-ext-stash",
	"kubevault-enterprise",
	"stash-enterprise",
	"voyager-enterprise",
)
View Source
var SupportedProducts = map[string]PlanInfo{
	"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-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-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},
	},
	"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": {
		DisplayName:  "ACE",
		ProductLine:  "platform",
		TierName:     "enterprise",
		Features:     []string{"panopticon-enterprise", "b3", "scanner"},
		MailingLists: []string{MailingList_Platform, MailingList_Panopticon},
	},
	"config-syncer-enterprise": {
		DisplayName:  "Config-Syncer",
		ProductLine:  "config-syncer",
		TierName:     "enterprise",
		Features:     []string{"config-syncer-enterprise"},
		MailingLists: []string{MailingList_Platform},
	},
}

plan name => features

Functions

func AddEventAttendants

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

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

func DecorateGeoData

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

func FolderName(email string) string

func FullLicenseIssueLogPath

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

func GetCertStore

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

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

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

func LogLicense

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

func NewBlockedLicenseMailer

func NewBlockedLicenseMailer(info LicenseMailData) mailer.Mailer

func NewCommunitySignupCampaign

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

func NewEULAMailer

func NewEULAMailer(info *EULAInfo) mailer.Mailer

func NewEnterpriseFirstTimeCampaign

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

func NewEnterpriseLicenseMailer

func NewEnterpriseLicenseMailer(info LicenseMailData) mailer.Mailer

func NewEnterpriseSignupCampaign

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

func NewLicenseMailer

func NewLicenseMailer(info LicenseMailData) mailer.Mailer

func NewOfferLetterMailer

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

func NewQuotationMailer

func NewQuotationMailer(info QuotationEmailData) mailer.Mailer

func NewQuotationProcessFailedMailer

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

func NewRegistrationMailer

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

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

func NewWelcomeMailer

func NewWelcomeMailer(info LicenseForm) mailer.Mailer

func ParseCouponCodes added in v0.0.62

func ParseCouponCodes(in string) map[string]string

func ProductAccessLogPath

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

func SanitizeTelNumber

func SanitizeTelNumber(tel string) string

func SaveConfig

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

func SaveTestAnswer

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

Types

type AltNames

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

type CandidateInfo

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"`

	PermanentSalary int `form:"perm-salary" binding:"Required" csv:"perm-salary"`
	// https://bulma-calendar.onrender.com/#content
	// format: MM/DD/YYYY 01/02/2006
	PermanentDate OfferDate `form:"perm-date" binding:"Required" csv:"perm-date"`

	OfferStartDate OfferDate `form:"-" csv:"offer-start-date"`
	OfferEndDate   OfferDate `form:"-" csv:"offer-end-date"`
}

func (*CandidateInfo) Complete

func (form *CandidateInfo) Complete()

func (CandidateInfo) Data

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

func (CandidateInfo) Validate

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

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

type EULAInfo

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

func (form *EULAInfo) Complete() error

func (EULAInfo) Data

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

func (EULAInfo) Validate

func (form EULAInfo) Validate() error

type EULATemplateKey

type EULATemplateKey struct {
	PaymentTerm string
	SupportPlan string
}

type EventLicenseIssued

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

	License LicenseRef `json:"license"`
}

type EventMailgun

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

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

type EventQuotationGenerated

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

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

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

type FeatureFlags

type FeatureFlags map[string]string

func (FeatureFlags) IsValid

func (f FeatureFlags) IsValid() error

func (FeatureFlags) ToSlice

func (f FeatureFlags) ToSlice() []string

type GeoLocation

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

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"`
	ProductAlias 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"`
	Coupon       string `form:"coupon" json:"coupon"`
}

func (LicenseForm) Product

func (form LicenseForm) Product() string

func (LicenseForm) Validate

func (form LicenseForm) Validate() error

type LicenseMailData

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

type LicenseRef

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

type LogEntry

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

func IssueEnterpriseLicense

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

func (LogEntry) Data

func (info LogEntry) Data() []string

func (LogEntry) Headers

func (_ LogEntry) Headers() []string

type Message

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

type NewsSnippet

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

type OfferDate string

func NewOfferOfferDate

func NewOfferOfferDate(t time.Time) OfferDate

func (OfferDate) Parse

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
	BlockedClusters []string

	EnableDripCampaign bool

	Coupons string
	// contains filtered or unexported fields
}

func NewOptions

func NewOptions() *Options

func (*Options) AddFlags

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

type PlanInfo

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

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

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

type QuestionConfig

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

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

type QuotationEmailData

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

type QuotationForm

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

func (form QuotationForm) Validate() error

type QuotationGenerator

type QuotationGenerator struct {
	Contact 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

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

func (*QuotationGenerator) DocName

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

func (*QuotationGenerator) Generate

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

func (*QuotationGenerator) GetMailer

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

type QuotationGeneratorConfig

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

type QuotationGeneratorOptions

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

	Contact QuotationForm
}

func (QuotationGeneratorOptions) Complete

func (QuotationGeneratorOptions) Validate

func (opts QuotationGeneratorOptions) Validate() error

type QuoteInfo

type QuoteInfo struct {
	TemplateDocId string
	MailingLists  []string
}

type RegisterRequest

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

type Scheduler

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

func NewScheduler

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

func (*Scheduler) Cleanup

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

func (*Scheduler) Close

func (s *Scheduler) Close() error

func (*Scheduler) Schedule

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

func (s *Server) Close()

func (*Server) CreateOrRetrieveLicense

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

func (*Server) GenerateEULA

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

func (*Server) GenerateOfferLetter

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

func (*Server) GetDomainLicense

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

func (*Server) HandleEmailQuotation

func (s *Server) HandleEmailQuotation(ctx *macaron.Context, contact 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

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

func (*Server) ListPlaylistItems

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

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

func (*Server) ListPlaylists

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

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

func (*Server) ListWebinarAttendees

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

func (*Server) NextNewsSnippet

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

func (*Server) NextWebinarSchedule

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

func (*Server) PastWebinarSchedules

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

func (*Server) RegisterForWebinar

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

func (*Server) RegisterNewsAPI

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

func (*Server) RegisterQAAPI

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

func (*Server) RegisterWebinarAPI

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

func (*Server) RegisterYoutubeAPI

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

func (*Server) RevokePermission

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

func (*Server) Run

func (s *Server) Run() error

func (*Server) TimelyNextNewsSnippet added in v0.0.46

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

func (*Server) UpcomingWebinarSchedules

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

type SignupCampaignData

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

type SpeakerInfo

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

func FixSpeakers

func FixSpeakers(sch *WebinarSchedule) []SpeakerInfo

type TestAnswer

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

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

type WebinarInfo

type WebinarInfo struct {
	WebinarSchedule
	WebinarMeetingID
}

type WebinarMeetingID

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

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

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

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

type WebinarRegistrationForm

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

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