Movatterモバイル変換


[0]ホーム

URL:


model

package
v1.5.1Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License:MITImports:13Imported by:0

Details

Repository

github.com/staticbackendhq/core

Links

Documentation

Index

Constants

View Source
const (PlanFree =iotaPlanIdeaPleanLaunchPlanTractionPlanGrowth)
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

funcCleanCollectionName

func CleanCollectionName(colstring)string

funcEncryptExternalLogins

func EncryptExternalLogins(tokens map[string]OAuthConfig) ([]byte,error)

Types

typeAccount

type Account struct {IDstring    `json:"id"`Emailstring    `json:"email"`Createdtime.Time `json:"created"`}

typeAuth

type Auth struct {AccountIDstring `json:"accountId"`UserIDstring `json:"userId"`Emailstring `json:"email"`Roleint    `json:"role"`Tokenstring `json:"-"`Planint    `json:"-"`}

Auth represents an authenticated user.

func (Auth)ReconstructToken

func (authAuth) ReconstructToken()string

typeCommand

type Command struct {SIDstring `json:"sid"`Typestring `json:"type"`Datastring `json:"data"`Channelstring `json:"channel"`Tokenstring `json:"token"`AuthAuth   `json:"auth"`Basestring `json:"base"`IsSystemEventbool   `json:"-"`}

func (Command)IsDBEvent

func (msgCommand) IsDBEvent()bool

typeDatabaseConfig

type DatabaseConfig struct {IDstring    `json:"id"`TenantIDstring    `json:"customerId"`Namestring    `json:"name"`AllowedDomain    []string  `json:"whitelist"`IsActivebool      `json:"-"`MonthlySentEmailint       `json:"-"`Createdtime.Time `json:"created"`}

typeExecData

type ExecData struct {IDstring        `json:"id"`AccountIDstring        `json:"accountId"`FunctionNamestring        `json:"name"`TriggerTopicstring        `json:"trigger"`Codestring        `json:"code"`Versionint           `json:"version"`LastUpdatedtime.Time     `json:"lastUpdated"`LastRuntime.Time     `json:"lastRun"`History      []ExecHistory `json:"history"`}

ExecData represents a server-side function with its name, code and executionhistory

typeExecHistory

type ExecHistory struct {IDstring    `json:"id"`FunctionIDstring    `json:"functionId"`Versionint       `json:"version"`Startedtime.Time `json:"started"`Completedtime.Time `json:"completed"`Successbool      `json:"success"`Output     []string  `json:"output"`}

ExecHistory represents a function run ending result

typeFile

type File struct {IDstring    `json:"id"`AccountIDstring    `json:"accountId"`Keystring    `json:"key"`URLstring    `json:"url"`Sizeint64     `json:"size"`Uploadedtime.Time `json:"uploaded"`}

typeJWTPayload

type JWTPayload struct {jwt.PayloadTokenstring `json:"token,omitempty"`}

JWTPayload contains the current user token

typeListParams

type ListParams struct {Pageint64Sizeint64SortBystringSortDescendingbool}

typeLogin

type Login struct {Emailstring `json:"email"`Passwordstring `json:"password"`}

typeMetaMessage

type MetaMessage struct {Datastring `json:"data"`Channelstring `json:"channel"`HTTPMethodstring `json:"method"`ContentTypestring `json:"ct"`HTTPHeadersstring `jsno:"headers"`}

typeOAuthConfig

type OAuthConfig struct {ConsumerKeystringConsumerSecretstring}

typePagedResult

type PagedResult struct {Pageint64                    `json:"page"`Sizeint64                    `json:"size"`Totalint64                    `json:"total"`Results []map[string]interface{} `json:"results"`}

typeTask

type Task struct {IDstring    `json:"id"`Namestring    `json:"name"`Typestring    ` json:"type"`Valuestring    ` json:"value"`Metastring    ` json:"meta"`Intervalstring    ` json:"interval"`LastRuntime.Time ` json:"last"`BaseNamestring `json:"base"`}

typeTenant

type Tenant struct {IDstring    `bson:"_id" json:"id"`Emailstring    `bson:"email" json:"email"`StripeIDstring    `bson:"stripeId" json:"stripeId"`SubscriptionIDstring    `bson:"subId" json:"subId"`Planint       `json:"plan"`IsActivebool      `bson:"active" json:"-"`MonthlyEmailSentint       `bson:"mes" json:"-"`Createdtime.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(providerstring) (cfgOAuthConfig, okbool)

typeUploadFileData

type UploadFileData struct {FileKeystringFileio.ReadSeeker}

typeUser

type User struct {IDstring    `json:"id"`AccountIDstring    `json:"accountId"`Tokenstring    `json:"token"`Emailstring    `json:"email"`Passwordstring    `json:"-"`Roleint       `json:"role"`ResetCodestring    `json:"-"`Createdtime.Time `json:"created"`}

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp