Documentation
¶
Index ¶
- Constants
- Variables
- func CleanCollectionName(col string) string
- func EncryptExternalLogins(tokens map[string]OAuthConfig) ([]byte, error)
- type Account
- type Auth
- type Command
- type DatabaseConfig
- type ExecData
- type ExecHistory
- type File
- type JWTPayload
- type ListParams
- type Login
- type MetaMessage
- type OAuthConfig
- type PagedResult
- type Task
- type Tenant
- type UploadFileData
- type User
Constants ¶
View Source
const ( PlanFree = iota PlanIdea PleanLaunch PlanTraction PlanGrowth )
View Source
const ( SystemID = "sb" MsgTypeError = "error" MsgTypeOk = "ok" MsgTypeEcho = "echo" MsgTypeInit = "init" MsgTypeAuth = "auth" MsgTypeToken = "token" MsgTypeJoin = "join" MsgTypeJoined = "joined" MsgTypePresence = "presence" MsgTypeChanIn = "chan_in" MsgTypeChanOut = "chan_out" MsgTypeDBCreated = "db_created" MsgTypeDBUpdated = "db_updated" MsgTypeDBDeleted = "db_deleted" MsgTypeFunctionCall = "fn_call" MsgTypeHTTPResponse = "http_response" )
View Source
const ( TaskTypeFunction = "function" TaskTypeMessage = "message" TaskTypeHTTP = "http" )
Variables ¶
View Source
var (
HashSecret *jwt.HMACSHA
)
Functions ¶
func CleanCollectionName ¶
func EncryptExternalLogins ¶
func EncryptExternalLogins(tokens map[string]OAuthConfig) ([]byte, error)
Types ¶
type Auth ¶
type Auth struct {
AccountID string `json:"accountId"`
UserID string `json:"userId"`
Email string `json:"email"`
Role int `json:"role"`
Token string `json:"-"`
Plan int `json:"-"`
}
Auth represents an authenticated user.
func (Auth) ReconstructToken ¶
type Command ¶
type DatabaseConfig ¶
type ExecData ¶
type ExecData struct {
ID string `json:"id"`
AccountID string `json:"accountId"`
FunctionName string `json:"name"`
TriggerTopic string `json:"trigger"`
Code string `json:"code"`
Version int `json:"version"`
LastUpdated time.Time `json:"lastUpdated"`
LastRun time.Time `json:"lastRun"`
History []ExecHistory `json:"history"`
}
ExecData represents a server-side function with its name, code and execution history
type ExecHistory ¶
type ExecHistory struct {
ID string `json:"id"`
FunctionID string `json:"functionId"`
Version int `json:"version"`
Started time.Time `json:"started"`
Completed time.Time `json:"completed"`
Success bool `json:"success"`
Output []string `json:"output"`
}
ExecHistory represents a function run ending result
type JWTPayload ¶
type JWTPayload struct {
jwt.Payload
Token string `json:"token,omitempty"`
}
JWTPayload contains the current user token
type ListParams ¶
type MetaMessage ¶
type OAuthConfig ¶
type PagedResult ¶
type Tenant ¶
type Tenant struct {
ID string `bson:"_id" json:"id"`
Email string `bson:"email" json:"email"`
StripeID string `bson:"stripeId" json:"stripeId"`
SubscriptionID string `bson:"subId" json:"subId"`
Plan int `json:"plan"`
IsActive bool `bson:"active" json:"-"`
MonthlyEmailSent int `bson:"mes" json:"-"`
Created time.Time `bson:"created" json:"created"`
ExternalLogins []byte `json:"-"`
}
func (*Tenant) GetExternalLogins ¶
func (cus *Tenant) GetExternalLogins() (map[string]OAuthConfig, error)
func (*Tenant) GetProvider ¶
func (cus *Tenant) GetProvider(provider string) (cfg OAuthConfig, ok bool)
type UploadFileData ¶
type UploadFileData struct {
FileKey string
File io.ReadSeeker
}
Click to show internal directories.
Click to hide internal directories.