model

package
v0.0.0-...-9e48597 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACTION_RUNTIME_INFO_FIELD_TEAM_ID          = "teamID"
	ACTION_RUNTIME_INFO_FIELD_APP_ID           = "appID"
	ACTION_RUNTIME_INFO_FIELD_RESOURCE_ID      = "resourceID"
	ACTION_RUNTIME_INFO_FIELD_ACTION_ID        = "actionID"
	ACTION_RUNTIME_INFO_FIELD_AUTHORIZATION    = "authorization"
	ACTION_RUNTIME_INFO_FIELD_RUN_BY_ANONYMOUS = "runByAnonymous"
	ACTION_RUNTIME_INFO_FIELD_CONTEXT          = "context"
)
View Source
const (
	ACTION_CONFIG_FIELD_PUBLIC           = "public"
	ACTION_CONFIG_FIELD_VIRTUAL_RESOURCE = "virtualResource"
)
View Source
const (
	APP_TYPE_PC     = 1
	APP_TYPE_MOBILE = 2
)
View Source
const (
	APP_TYPE_STRING_PC     = "pc"
	APP_TYPE_STRING_MOBILE = "mobile"
)
View Source
const (
	SNAPSHOT_TRIGGER_MODE_AUTO   = 1
	SNAPSHOT_TRIGGER_MODE_MANUAL = 2
)
View Source
const (
	GOOGLE_SHEETS_OAUTH2_ACCESS_TYPE_INVALIED       = 0
	GOOGLE_SHEETS_OAUTH2_ACCESS_TYPE_READ_AND_WRITE = 1
	GOOGLE_SHEETS_OAUTH2_ACCESS_TYPE_READ_ONLY      = 2
)
View Source
const (
	GOOGLE_SHEETS_OAUTH_STATUS_SUCCESS = 1
	GOOGLE_SHEETS_OAUTH_STATUS_FAILED  = 2
)
View Source
const (
	TREE_STATE_FIELD_DISPLAY_NAME = "displayName"
	TREE_STATE_FIELD_PARENT_NODE  = "parentNode"
)
View Source
const (
	CONNECTION_ZONE_SOUTH_ASIA    = "southAsia"
	CONNECTION_ZONE_EAST_ASIA     = "eastAsia"
	CONNECTION_ZONE_CENTER_EUROPE = "centerEurope"
)
View Source
const (
	ACTION_FOR_EXPORT_FIELD_VIRTUAL_RESOURCE = "virtualResource"
)
View Source
const (
	ANONYMOUS_USER_ID = -1
)

anonymous user config

View Source
const APP_AUTO_MAINLINE_VERSION = -1 // -1 for get latest mainline version automatically
View Source
const APP_AUTO_RELEASE_VERSION = -2 // -1 for get latest release version automatically
View Source
const APP_CONFIG_FIELD_APP_TYPE = "appType"
View Source
const APP_CONFIG_FIELD_DESCRIPTION = "description"
View Source
const APP_CONFIG_FIELD_PUBLIC = "public"
View Source
const APP_CONFIG_FIELD_PUBLISHED_TO_MARKETPLACE = "publishedToMarketplace"
View Source
const APP_CONFIG_FIELD_PUBLISH_WITH_AI_AGENT = "publishWithAIAgent"
View Source
const APP_CONFIG_FIELD_WATER_MARK = "waterMark"
View Source
const APP_EDITED_BY_MAX_LENGTH = 4
View Source
const APP_EDIT_VERSION = 0 // the editable version app ID always be 0
View Source
const APP_FIELD_NAME = "appName"
View Source
const APP_MODIFY_HISTORY_MAX_LEN = 10
View Source
const APP_SNAPSHOT_PERIOD = time.Second * 300 // 5 min
View Source
const CUSTOMIZATION_LANGUAGE_EN_US = "en-US"
View Source
const CUSTOMIZATION_LANGUAGE_ZH_CN = "zh-CN"
View Source
const DASHBOARD_WS_URL = "%s://%s/teams/%s/room/websocketConnection/dashboard"
View Source
const DEFAULT_PAGE_LIMIT = 10
View Source
const DEFAULT_SORT_ORDER = "id desc"
View Source
const (
	FLOW_ACTION_EDIT_VERSION = 0
)
View Source
const (
	GOOGLE_OAUTH2_TOKEN_DEFAULT_EXIPRED_PERIOD = time.Minute * 60
)
View Source
const (
	GOOGLE_SHEET_OAUTH_TYPE = "oauth2"
)
View Source
const (
	INVALIED_ACTION_ID = 0
)
View Source
const (
	KV_STATE_FIELD_DISPLAY_NAME = "displayName"
)
View Source
const KV_STATE_TYPE_DEPENDENCIES = 2 // DependenciesState
View Source
const KV_STATE_TYPE_DOTTED_LINE_SQUARE = 4 // DottedLineSquareState
View Source
const KV_STATE_TYPE_DRAG_SHADOW = 3 // DragShadowState
View Source
const PENDING_USER_AVATAR = ""
View Source
const PENDING_USER_NICKNAME = "pending"
View Source
const PENDING_USER_PASSWORDDIGEST = "pending"
View Source
const PROTOCOL_WEBSOCKET = "ws"
View Source
const PROTOCOL_WEBSOCKET_OVER_TLS = "wss"
View Source
const ROOM_BINARY_WS_URL = "%s://%s/teams/%s/room/binaryWebsocketConnection/apps/%s"
View Source
const ROOM_WS_URL = "%s://%s/teams/%s/room/websocketConnection/apps/%s"
View Source
const SELF_HOST_DASHBOARD_WS_URL = "/builder-ws/teams/%s/room/websocketConnection/dashboard"
View Source
const SELF_HOST_ROOM_BINARY_WS_URL = "/builder-ws/teams/%s/room/binaryWebsocketConnection/apps/%s"
View Source
const SELF_HOST_ROOM_WS_URL = "/builder-ws/teams/%s/room/websocketConnection/apps/%s"
View Source
const (
	SET_STATE_FIELD_DISPLAY_NAME = "displayName"
)
View Source
const SET_STATE_TYPE_DISPLAY_NAME = 5 // DisplayNameState
View Source
const SNAPSHOT_TARGET_APP = "app"
View Source
const STATE_TYPE_INVALIED = 0

define StateType

View Source
const TREE_STATE_SUMMIT_ID = 0
View Source
const TREE_STATE_SUMMIT_NAME = "root"
View Source
const TREE_STATE_TYPE_COMPONENTS = 1 // ComponentsState

Variables

View Source
var CountryCodeMappedIngressAddress = map[string]string{

	"AF": CONNECTION_ZONE_EAST_ASIA,
	"CN": CONNECTION_ZONE_EAST_ASIA,
	"JP": CONNECTION_ZONE_EAST_ASIA,
	"KP": CONNECTION_ZONE_EAST_ASIA,
	"HK": CONNECTION_ZONE_EAST_ASIA,
	"MO": CONNECTION_ZONE_EAST_ASIA,
	"MN": CONNECTION_ZONE_EAST_ASIA,
	"KR": CONNECTION_ZONE_EAST_ASIA,
	"TW": CONNECTION_ZONE_EAST_ASIA,

	"TL": CONNECTION_ZONE_SOUTH_ASIA,
	"ID": CONNECTION_ZONE_SOUTH_ASIA,
	"LA": CONNECTION_ZONE_SOUTH_ASIA,
	"IN": CONNECTION_ZONE_SOUTH_ASIA,
	"MY": CONNECTION_ZONE_SOUTH_ASIA,
	"MM": CONNECTION_ZONE_SOUTH_ASIA,
	"PH": CONNECTION_ZONE_SOUTH_ASIA,
	"SG": CONNECTION_ZONE_SOUTH_ASIA,
	"BD": CONNECTION_ZONE_SOUTH_ASIA,
	"BT": CONNECTION_ZONE_SOUTH_ASIA,
	"IR": CONNECTION_ZONE_SOUTH_ASIA,
	"MV": CONNECTION_ZONE_SOUTH_ASIA,
	"NP": CONNECTION_ZONE_SOUTH_ASIA,
	"PK": CONNECTION_ZONE_SOUTH_ASIA,
	"LK": CONNECTION_ZONE_SOUTH_ASIA,
	"KZ": CONNECTION_ZONE_SOUTH_ASIA,
	"KG": CONNECTION_ZONE_SOUTH_ASIA,
	"TJ": CONNECTION_ZONE_SOUTH_ASIA,
	"TM": CONNECTION_ZONE_SOUTH_ASIA,
	"UZ": CONNECTION_ZONE_SOUTH_ASIA,

	"AX": CONNECTION_ZONE_CENTER_EUROPE,
	"AL": CONNECTION_ZONE_CENTER_EUROPE,
	"AD": CONNECTION_ZONE_CENTER_EUROPE,
	"AT": CONNECTION_ZONE_CENTER_EUROPE,
	"BY": CONNECTION_ZONE_CENTER_EUROPE,
	"BE": CONNECTION_ZONE_CENTER_EUROPE,
	"BA": CONNECTION_ZONE_CENTER_EUROPE,
	"BG": CONNECTION_ZONE_CENTER_EUROPE,
	"HR": CONNECTION_ZONE_CENTER_EUROPE,
	"CV": CONNECTION_ZONE_CENTER_EUROPE,
	"CZ": CONNECTION_ZONE_CENTER_EUROPE,
	"DK": CONNECTION_ZONE_CENTER_EUROPE,
	"EE": CONNECTION_ZONE_CENTER_EUROPE,
	"FO": CONNECTION_ZONE_CENTER_EUROPE,
	"FI": CONNECTION_ZONE_CENTER_EUROPE,
	"FR": CONNECTION_ZONE_CENTER_EUROPE,
	"DE": CONNECTION_ZONE_CENTER_EUROPE,
	"GI": CONNECTION_ZONE_CENTER_EUROPE,
	"GR": CONNECTION_ZONE_CENTER_EUROPE,
	"GG": CONNECTION_ZONE_CENTER_EUROPE,
	"HU": CONNECTION_ZONE_CENTER_EUROPE,
	"IS": CONNECTION_ZONE_CENTER_EUROPE,
	"IE": CONNECTION_ZONE_CENTER_EUROPE,
	"IT": CONNECTION_ZONE_CENTER_EUROPE,
	"JE": CONNECTION_ZONE_CENTER_EUROPE,
	"XK": CONNECTION_ZONE_CENTER_EUROPE,
	"LV": CONNECTION_ZONE_CENTER_EUROPE,
	"LI": CONNECTION_ZONE_CENTER_EUROPE,
	"LT": CONNECTION_ZONE_CENTER_EUROPE,
	"LU": CONNECTION_ZONE_CENTER_EUROPE,
	"MT": CONNECTION_ZONE_CENTER_EUROPE,
	"IM": CONNECTION_ZONE_CENTER_EUROPE,
	"MD": CONNECTION_ZONE_CENTER_EUROPE,
	"MC": CONNECTION_ZONE_CENTER_EUROPE,
	"ME": CONNECTION_ZONE_CENTER_EUROPE,
	"NL": CONNECTION_ZONE_CENTER_EUROPE,
	"MK": CONNECTION_ZONE_CENTER_EUROPE,
	"NO": CONNECTION_ZONE_CENTER_EUROPE,
	"PL": CONNECTION_ZONE_CENTER_EUROPE,
	"PT": CONNECTION_ZONE_CENTER_EUROPE,
	"RO": CONNECTION_ZONE_CENTER_EUROPE,
	"RU": CONNECTION_ZONE_CENTER_EUROPE,
	"SM": CONNECTION_ZONE_CENTER_EUROPE,
	"RS": CONNECTION_ZONE_CENTER_EUROPE,
	"SK": CONNECTION_ZONE_CENTER_EUROPE,
	"SI": CONNECTION_ZONE_CENTER_EUROPE,
	"ES": CONNECTION_ZONE_CENTER_EUROPE,
	"SJ": CONNECTION_ZONE_CENTER_EUROPE,
	"SE": CONNECTION_ZONE_CENTER_EUROPE,
	"CH": CONNECTION_ZONE_CENTER_EUROPE,
}

Functions

func BuildTreeStateLookupTable

func BuildTreeStateLookupTable(treeStates []*TreeState) map[int]*TreeState

func DoesActionHasBeenCreated

func DoesActionHasBeenCreated(actionID int) bool

func DoesFlowActionHasBeenCreated

func DoesFlowActionHasBeenCreated(actionID int) bool

func ExportComponentTreeAllDisplayNames

func ExportComponentTreeAllDisplayNames(cnode *ComponentNode, displayNames []string)

func ExtractAllEditorIDFromApps

func ExtractAllEditorIDFromApps(apps []*App) []int

func ExtractAllModifierIDFromAppSnapshot

func ExtractAllModifierIDFromAppSnapshot(appSnapshots []*AppSnapshot) []int

func ExtractComponentsNameList

func ExtractComponentsNameList(treeStates []*TreeState) []string

the tree_state content field like:

{
    "h": 110,
    "w": 64,
    "x": 0,
    "y": 11,
    "z": 0,
    "minH": 3,
    "minW": 2,
    "type": "CONTAINER_WIDGET",
    "error": false,
    "props": {
        "radius": "4px",
        "shadow": "small",
        "viewList": [
            {
                "id": "b58e92d5-22c3-4ffd-a4bc-aab23675387f",
                "key": "View 1",
                "label": "View 1"
            }
        ],
        "currentKey": "View 1",
        "borderColor": "#ffffffff",
        "borderWidth": "0px",
        "currentIndex": 0,
        "dynamicHeight": "fixed",
        "backgroundColor": "#f7f7f7ff",
        "resizeDirection": "ALL",
        "$dynamicAttrPaths": []
    },
    "unitH": 8,
    "unitW": 18.109375,
    "showName": "container",
    "isDragging": false,
    "parentNode": "",
    "displayName": "container9",
    "panelConfig": null,
    "childrenNode": null,
    "containerType": "EDITOR_SCALE_SQUARE",
    "verticalResize": false
}

we need extract type field which suffixed with "_WIDGET" and put them in to slice and return.

func GenerateGoogleSheetsOAuth2Token

func GenerateGoogleSheetsOAuth2Token(teamID int, userID int, resourceID int, createOAuthTokenRequest *request.CreateOAuthTokenRequest) (string, error)

func NewUsersByDataControlRawData

func NewUsersByDataControlRawData(rawUsersString string) (map[int]*User, error)

func ResolveDisplayNameByPayload

func ResolveDisplayNameByPayload(data interface{}) (string, error)

Types

type Action

type Action struct {
	ID            int       `gorm:"column:id;type:bigserial;primary_key"`
	UID           uuid.UUID `gorm:"column:uid;type:uuid;not null"`
	TeamID        int       `gorm:"column:team_id;type:bigserial"`
	AppRefID      int       `gorm:"column:app_ref_id;type:bigint;not null"`
	Version       int       `gorm:"column:version;type:bigint;not null"`
	ResourceRefID int       `gorm:"column:resource_ref_id;type:bigint;not null"`
	Name          string    `gorm:"column:name;type:varchar;size:255;not null"`
	Type          int       `gorm:"column:type;type:smallint;not null"`
	TriggerMode   string    `gorm:"column:trigger_mode;type:varchar;size:16;not null"`
	Transformer   string    `gorm:"column:transformer;type:jsonb"`
	Template      string    `gorm:"column:template;type:jsonb"`
	RawTemplate   string    `gorm:"-" sql:"-"`
	Config        string    `gorm:"column:config;type:jsonb"`
	CreatedAt     time.Time `gorm:"column:created_at;type:timestamp;not null"`
	CreatedBy     int       `gorm:"column:created_by;type:bigint;not null"`
	UpdatedAt     time.Time `gorm:"column:updated_at;type:timestamp;not null"`
	UpdatedBy     int       `gorm:"column:updated_by;type:bigint;not null"`
}

func NewAcitonByCreateActionRequest

func NewAcitonByCreateActionRequest(app *App, userID int, req *request.CreateActionRequest) (*Action, error)

func NewAcitonByRunActionRequest

func NewAcitonByRunActionRequest(app *App, userID int, req *request.RunActionRequest) *Action

func NewAcitonByUpdateActionRequest

func NewAcitonByUpdateActionRequest(app *App, userID int, req *request.UpdateActionRequest) (*Action, error)

func NewAction

func NewAction() *Action

func (*Action) AppendNewVersion

func (action *Action) AppendNewVersion(newVersion int)

func (*Action) AppendRuntimeInfoForVirtualResource

func (action *Action) AppendRuntimeInfoForVirtualResource(authorization string, teamID int)

the action runtime does not pass the env info for virtual resource, so add them.

func (*Action) CleanID

func (action *Action) CleanID()

func (*Action) ExportConfig

func (action *Action) ExportConfig() *ActionConfig

func (*Action) ExportConfigInMap

func (action *Action) ExportConfigInMap() map[string]interface{}

func (*Action) ExportDisplayName

func (action *Action) ExportDisplayName() string

func (*Action) ExportID

func (action *Action) ExportID() int

func (*Action) ExportIcon

func (action *Action) ExportIcon() string

func (*Action) ExportRawTemplateInMap

func (action *Action) ExportRawTemplateInMap() map[string]interface{}

func (*Action) ExportResourceID

func (action *Action) ExportResourceID() int

func (*Action) ExportTemplateInMap

func (action *Action) ExportTemplateInMap() map[string]interface{}

func (*Action) ExportTransformerInMap

func (action *Action) ExportTransformerInMap() map[string]interface{}

func (*Action) ExportType

func (action *Action) ExportType() int

func (*Action) ExportTypeInString

func (action *Action) ExportTypeInString() string

func (*Action) InitCreatedAt

func (action *Action) InitCreatedAt()

func (*Action) InitForFork

func (action *Action) InitForFork(teamID int, appID int, version int, userID int)

func (*Action) InitUID

func (action *Action) InitUID()

func (*Action) InitUpdatedAt

func (action *Action) InitUpdatedAt()

func (*Action) IsLocalVirtualAction

func (action *Action) IsLocalVirtualAction() bool

func (*Action) IsPublic

func (action *Action) IsPublic() bool

func (*Action) IsRemoteVirtualAction

func (action *Action) IsRemoteVirtualAction() bool

func (*Action) IsVirtualAction

func (action *Action) IsVirtualAction() bool

func (*Action) MergeRunActionContextToRawTemplate

func (action *Action) MergeRunActionContextToRawTemplate(context map[string]interface{})

func (*Action) RewritePublicSettings

func (action *Action) RewritePublicSettings(isPublic bool)

WARRING! this is an view-level method, do not use this method to sync database changes, just for export data.

func (*Action) SetPrivate

func (action *Action) SetPrivate(userID int)

func (*Action) SetPublic

func (action *Action) SetPublic(userID int)

func (*Action) SetResourceIDByAiAgent

func (action *Action) SetResourceIDByAiAgent(aiAgent *kozmoresourcemanagersdk.AIAgentForExport)
func (action *Action) SetTutorialLink(link string, userID int)

func (*Action) UpdateAcitonByUpdateActionRequest

func (action *Action) UpdateAcitonByUpdateActionRequest(app *App, userID int, req *request.UpdateActionRequest)

func (*Action) UpdateAppConfig

func (action *Action) UpdateAppConfig(actionConfig *ActionConfig, userID int)

func (*Action) UpdateWithRunActionRequest

func (action *Action) UpdateWithRunActionRequest(req *request.RunActionRequest, userID int)

type ActionConfig

type ActionConfig struct {
	Public            bool            `json:"public"` // switch for public action (which can view by anonymous user)
	IsVirtualResource bool            `json:"isVirtualResource"`
	AdvancedConfig    *AdvancedConfig `json:"advancedConfig"` // 2023_4_20: add advanced config for action
	MockConfig        *MockConfig     `json:"mockConfig"`
	TutorialLink      string          `json:"tutorialLink"`
}

func NewActionConfig

func NewActionConfig() *ActionConfig

func NewActionConfigByConfigActionRawRequest

func NewActionConfigByConfigActionRawRequest(rawReq map[string]interface{}) (*ActionConfig, error)

func NewActionConfigByConfigAppRawRequest

func NewActionConfigByConfigAppRawRequest(rawReq map[string]interface{}) (*ActionConfig, error)

func (*ActionConfig) ExportToJSONString

func (ac *ActionConfig) ExportToJSONString() string

func (*ActionConfig) SetIsNotVirtualResource

func (ac *ActionConfig) SetIsNotVirtualResource()

func (*ActionConfig) SetIsVirtualResource

func (ac *ActionConfig) SetIsVirtualResource()

func (*ActionConfig) SetPrivate

func (ac *ActionConfig) SetPrivate()

func (*ActionConfig) SetPublic

func (ac *ActionConfig) SetPublic()
func (ac *ActionConfig) SetTutorialLink(link string)

type ActionFactory

type ActionFactory struct {
	Type int
}

func NewActionFactoryByAction

func NewActionFactoryByAction(action *Action) *ActionFactory

func NewActionFactoryByResource

func NewActionFactoryByResource(resource *Resource) *ActionFactory

func NewFlowActionFactoryByFlowAction

func NewFlowActionFactoryByFlowAction(flowAction *FlowAction) *ActionFactory

func (*ActionFactory) Build

func (f *ActionFactory) Build() (common.DataConnector, error)

type ActionForExport

type ActionForExport struct {
	ID                string                 `json:"actionID"`
	UID               uuid.UUID              `json:"uid"`
	TeamID            string                 `json:"teamID"`
	App               string                 `json:"-"`
	Version           int                    `json:"-"`
	Resource          string                 `json:"resourceID,omitempty"`
	DisplayName       string                 `json:"displayName"`
	Type              string                 `json:"actionType"`
	IsVirtualResource bool                   `json:"isVirtualResource"`
	Template          map[string]interface{} `json:"content"`
	Transformer       map[string]interface{} `json:"transformer"`
	TriggerMode       string                 `json:"triggerMode"`
	Config            *ActionConfig          `json:"config"`
	CreatedAt         time.Time              `json:"createdAt,omitempty"`
	CreatedBy         string                 `json:"createdBy,omitempty"`
	UpdatedAt         time.Time              `json:"updatedAt,omitempty"`
	UpdatedBy         string                 `json:"updatedBy,omitempty"`
}

func NewActionForExport

func NewActionForExport(action *Action) *ActionForExport

func NewActionForExportByMap

func NewActionForExportByMap(data interface{}) (*ActionForExport, error)

func (*ActionForExport) AppendVirtualResourceToTemplate

func (resp *ActionForExport) AppendVirtualResourceToTemplate(value interface{})

func (*ActionForExport) ExportDisplayName

func (resp *ActionForExport) ExportDisplayName() string

func (*ActionForExport) ExportForFeedback

func (resp *ActionForExport) ExportForFeedback() interface{}

func (*ActionForExport) ExportResourceID

func (resp *ActionForExport) ExportResourceID() string

func (*ActionForExport) ExportResourceIDInInt

func (resp *ActionForExport) ExportResourceIDInInt() int

func (*ActionForExport) ExportTeamID

func (resp *ActionForExport) ExportTeamID() string

type ActionSummaryForExport

type ActionSummaryForExport struct {
	ID                string    `json:"actionID"`
	UID               uuid.UUID `json:"uid"`
	TeamID            string    `json:"teamID"`
	Version           int       `json:"version"`
	Resource          string    `json:"resourceID,omitempty"`
	DisplayName       string    `json:"name"`
	Icon              string    `json:"icon"`
	Type              string    `json:"type"`
	IsVirtualResource bool      `json:"isVirtualResource"`
	CreatedAt         time.Time `json:"createdAt,omitempty"`
	CreatedBy         string    `json:"createdBy,omitempty"`
	UpdatedAt         time.Time `json:"updatedAt,omitempty"`
	UpdatedBy         string    `json:"updatedBy,omitempty"`
}

func ExportAllActionASActionSummary

func ExportAllActionASActionSummary(actions []*Action) []*ActionSummaryForExport

func NewActionSummaryForExportByAction

func NewActionSummaryForExportByAction(action *Action) *ActionSummaryForExport

type AdvancedConfig

type AdvancedConfig struct {
	Runtime            string   `json:"runtime"`
	Pages              []string `json:"pages"`
	DelayWhenLoaded    string   `json:"delayWhenLoaded"`
	DisplayLoadingPage bool     `json:"displayLoadingPage"`
	IsPeriodically     bool     `json:"isPeriodically"`
	PeriodInterval     string   `json:"periodInterval"`
	Mock               string   `json:"mock"`
}

type App

type App struct {
	ID              int       `json:"id" gorm:"column:id;type:bigserial;primary_key;unique"`
	UID             uuid.UUID `json:"uid" gorm:"column:uid;type:uuid;not null"`
	TeamID          int       `json:"teamID" gorm:"column:team_id;type:bigserial"`
	Name            string    `json:"name" gorm:"column:name;type:varchar"`
	ReleaseVersion  int       `json:"releaseVersion" gorm:"column:release_version;type:bigserial"`
	MainlineVersion int       `json:"mainlineVersion" gorm:"column:mainline_version;type:bigserial"`
	Config          string    `json:"config" gorm:"column:config;type:jsonb"`
	CreatedAt       time.Time `json:"createdAt" gorm:"column:created_at;type:timestamp"`
	CreatedBy       int       `json:"createdBy" gorm:"column:created_by;type:bigserial"`
	UpdatedAt       time.Time `json:"updatedAt" gorm:"column:updated_at;type:timestamp"`
	UpdatedBy       int       `json:"updatedBy" gorm:"column:updated_by;type:bigserial"`
	EditedBy        string    `json:"editedBy" gorm:"column:edited_by;type:jsonb"`
}

func NewAppByCreateAppRequest

func NewAppByCreateAppRequest(req *request.CreateAppRequest, teamID int, modifyUserID int) (*App, error)

func NewAppForDuplicate

func NewAppForDuplicate(targetApp *App, newAppName string, modifyUserID int) *App

func (*App) BumpMainlineVersion

func (app *App) BumpMainlineVersion()

func (*App) BumpMainlineVersionOverReleaseVersion

func (app *App) BumpMainlineVersionOverReleaseVersion()

func (*App) ExportAppName

func (app *App) ExportAppName() string

func (*App) ExportAppType

func (app *App) ExportAppType() int

func (*App) ExportConfig

func (app *App) ExportConfig() *AppConfig

func (*App) ExportCreatedBy

func (app *App) ExportCreatedBy() int

func (*App) ExportEditedBy

func (app *App) ExportEditedBy() []*AppEditedBy

func (*App) ExportID

func (app *App) ExportID() int

func (*App) ExportMainlineVersion

func (app *App) ExportMainlineVersion() int

func (*App) ExportModifiedAllUserIDs

func (app *App) ExportModifiedAllUserIDs() []int

func (*App) ExportReleaseVersion

func (app *App) ExportReleaseVersion() int

func (*App) ExportTeamID

func (app *App) ExportTeamID() int

func (*App) ExportUpdatedAt

func (app *App) ExportUpdatedAt() time.Time

func (*App) ExportUpdatedBy

func (app *App) ExportUpdatedBy() int

func (*App) ImportEditedBy

func (app *App) ImportEditedBy(appEditedBys []*AppEditedBy)

func (*App) InitCreatedAt

func (app *App) InitCreatedAt()

func (*App) InitForFork

func (app *App) InitForFork(teamID int, modifyUserID int)

func (*App) InitUID

func (app *App) InitUID()

func (*App) InitUpdatedAt

func (app *App) InitUpdatedAt()

func (*App) IsPublic

func (app *App) IsPublic() bool

func (*App) IsPublishWithAIAgent

func (app *App) IsPublishWithAIAgent() bool

func (*App) IsPublishedToMarketplace

func (app *App) IsPublishedToMarketplace() bool

func (*App) Modify

func (app *App) Modify(userID int)

func (*App) PushEditedBy

func (app *App) PushEditedBy(currentEditedBy *AppEditedBy)

func (*App) Release

func (app *App) Release()

func (*App) ReleaseMainlineVersion

func (app *App) ReleaseMainlineVersion()

func (*App) RewritePublicSettings

func (app *App) RewritePublicSettings(isPublic bool)

WARRING! this is an view-level method, do not use this method to sync database changes, just for export data.

func (*App) SetID

func (app *App) SetID(appID int)

func (*App) SetNotPublishedToMarketplace

func (app *App) SetNotPublishedToMarketplace(userID int)

func (*App) SetPrivate

func (app *App) SetPrivate(userID int)

func (*App) SetPublic

func (app *App) SetPublic(userID int)

func (*App) SetPublishedToMarketplace

func (app *App) SetPublishedToMarketplace(publishedToMarketpalce bool, modifyUserID int)

func (*App) SyncMainlineVersionWithTreeStateLatestVersion

func (app *App) SyncMainlineVersionWithTreeStateLatestVersion(treeStateLatestVersion int)

func (*App) UpdateAppByConfigAppRawRequest

func (app *App) UpdateAppByConfigAppRawRequest(rawReq map[string]interface{}) error

func (*App) UpdateAppConfig

func (app *App) UpdateAppConfig(appConfig *AppConfig, userID int)

type AppActivity

type AppActivity struct {
	Modifier   string    `json:"modifier"`
	ModifiedAt time.Time `json:"modifiedAt"`
}

func NewAppActivity

func NewAppActivity() *AppActivity

func NewAppActivityWithPayload

func NewAppActivityWithPayload(userName string, updatedAt time.Time) *AppActivity

type AppConfig

type AppConfig struct {
	Public                 bool   `json:"public"` // switch for public app (which can view by anonymous user)
	WaterMark              bool   `json:"waterMark"`
	Description            string `json:"description"`
	PublishedToMarketplace bool   `json:"publishedToMarketplace"`
	PublishWithAIAgent     bool   `json:"publishWithAIAgent"`
	Cover                  string `json:"cover"`
	AppType                int    `json:"appType"`
}

func NewAppConfig

func NewAppConfig() *AppConfig

func NewAppConfigByDefault

func NewAppConfigByDefault() *AppConfig

func (*AppConfig) DisableWaterMark

func (appConfig *AppConfig) DisableWaterMark()

func (*AppConfig) EnableWaterMark

func (appConfig *AppConfig) EnableWaterMark()

func (*AppConfig) ExportAppType

func (appConfig *AppConfig) ExportAppType() int

func (*AppConfig) ExportAppTypeToString

func (appConfig *AppConfig) ExportAppTypeToString() string

func (*AppConfig) ExportToJSONString

func (appConfig *AppConfig) ExportToJSONString() string

func (*AppConfig) IsPublic

func (appConfig *AppConfig) IsPublic() bool

func (*AppConfig) SetAppType

func (appConfig *AppConfig) SetAppType(appType int)

func (*AppConfig) SetAppTypeByString

func (appConfig *AppConfig) SetAppTypeByString(appType string) error

func (*AppConfig) SetCover

func (appConfig *AppConfig) SetCover(cover string)

func (*AppConfig) SetNotPublishWithAIAgent

func (appConfig *AppConfig) SetNotPublishWithAIAgent()

func (*AppConfig) SetNotPublishedToMarketplace

func (appConfig *AppConfig) SetNotPublishedToMarketplace()

func (*AppConfig) SetPublishWithAIAgent

func (appConfig *AppConfig) SetPublishWithAIAgent()

func (*AppConfig) SetublishedToMarketplace

func (appConfig *AppConfig) SetublishedToMarketplace()

func (*AppConfig) UpdateAppConfigByConfigAppRawRequest

func (appConfig *AppConfig) UpdateAppConfigByConfigAppRawRequest(rawReq map[string]interface{}) error

type AppConfigForExport

type AppConfigForExport struct {
	Public                 bool                      `json:"public"` // switch for public app (which can view by anonymous user)
	WaterMark              bool                      `json:"waterMark"`
	Description            string                    `json:"description"`
	PublishedToMarketplace bool                      `json:"publishedToMarketplace"`
	PublishWithAIAgent     bool                      `json:"publishWithAIAgent"`
	Cover                  string                    `json:"cover"`
	AppType                string                    `json:"appType"`
	Components             []string                  `json:"components"`
	Actions                []*ActionSummaryForExport `json:"actions"`
}

func NewAppConfigForExport

func NewAppConfigForExport(appConfig *AppConfig, treeStates []*TreeState, actions []*Action) *AppConfigForExport

func NewAppConfigForExportWithoutComponentsAndActions

func NewAppConfigForExportWithoutComponentsAndActions(appConfig *AppConfig) *AppConfigForExport

type AppEditedBy

type AppEditedBy struct {
	UserID   int       `json:"userID"`
	EditedAt time.Time `json:"editedAt"`
}

func NewAppEditedByUser

func NewAppEditedByUser(user *User) *AppEditedBy

func NewAppEditedByUserID

func NewAppEditedByUserID(userID int) *AppEditedBy

func (*AppEditedBy) ExportToJSONString

func (a *AppEditedBy) ExportToJSONString() string

type AppForExport

type AppForExport struct {
	ID              string              `json:"appId"` // generated by database primary key serial
	UID             uuid.UUID           `json:"uid"`
	TeamID          string              `json:"teamID"`
	Name            string              `json:"appName" validate:"required"`
	ReleaseVersion  int                 `json:"releaseVersion"`  // release version used for mark the app release version.
	MainlineVersion int                 `json:"mainlineVersion"` // mainline version keep the newest app version in database.
	Deployed        bool                `json:"deployed"`
	Config          *AppConfigForExport `json:"config"`
	CreatedBy       string              `json:"-" `
	CreatedAt       time.Time           `json:"-"`
	UpdatedBy       string              `json:"updatedBy"`
	UpdatedAt       time.Time           `json:"updatedAt"`
	AppActivity     *AppActivity        `json:"appActivity"`
	EditedBy        []*UserForEditedBy  `json:"editedBy"`
}

func NewAppForExport

func NewAppForExport(a *App, usersLT map[int]*User) *AppForExport

func NewAppForExportByMap

func NewAppForExportByMap(data interface{}) (*AppForExport, error)

func NewAppForExportWithFullConfigInfo

func NewAppForExportWithFullConfigInfo(a *App, usersLT map[int]*User, treeStates []*TreeState, actions []*Action) *AppForExport

func (*AppForExport) CalculateIsDeployed

func (appForExport *AppForExport) CalculateIsDeployed()

func (*AppForExport) ExportForFeedback

func (resp *AppForExport) ExportForFeedback() interface{}

func (*AppForExport) ExportName

func (resp *AppForExport) ExportName() string

type AppModifyHistory

type AppModifyHistory struct {
	Operation                 int         `json:"operation"  	            gorm:"column:operation;type:smallint"`              // same as websocket protol signal
	OperationTarget           int         `json:"operationTarget"           gorm:"column:operation_target;type:smallint"`     // same as websocket protol target
	OperationTargetName       string      `json:"operationTargetName"       gorm:"column:operation_target_name;type:varchar"` // smae as app name or components display name
	OperationBroadcastType    string      `json:"operationBroadcastType"    gorm:"column:operation_broadcast_type;type:varchar"`
	OperationBroadcastPayload interface{} `json:"operationBroadcastPayload" gorm:"column:operation_broadcast_payload;type:varchar"`
	OperationTargetModifiedAt time.Time   `json:"operationTargetModifiedAt" gorm:"column:operation_target_modified_at;type:timestamp"`
	ModifiedBy                int         `json:"modifiedBy" 		        gorm:"column:modified_by;type:timestamp"`
	ModifiedAt                time.Time   `json:"modifiedAt" 		        gorm:"column:modified_at;type:timestamp"`
}

func NewAppModifyHistory

func NewAppModifyHistory(operation int, target int, name string, broadcastType string, broadcastpayload interface{}, modifyBy int) *AppModifyHistory

func NewRecoverAppSnapshotModifyHistory

func NewRecoverAppSnapshotModifyHistory(modifyBy int, targetAppSnapshot *AppSnapshot) *AppModifyHistory

func NewTakeAppSnapshotModifyHistory

func NewTakeAppSnapshotModifyHistory(modifyBy int) *AppModifyHistory

func (*AppModifyHistory) ExportModifiedBy

func (appModifyHistory *AppModifyHistory) ExportModifiedBy() int

func (*AppModifyHistory) ExportToJSONString

func (a *AppModifyHistory) ExportToJSONString() string

func (*AppModifyHistory) InitModifiedAt

func (appModifyHistory *AppModifyHistory) InitModifiedAt()

type AppModifyHistoryForExport

type AppModifyHistoryForExport struct {
	Operation                 int                `json:"operation"  	           gorm:"column:operation;type:smallint"`               // same as websocket protol signal
	OperationTarget           int                `json:"operationTarget"           gorm:"column:operation_target;type:smallint"`     // same as websocket protol target
	OperationTargetName       string             `json:"operationTargetName"       gorm:"column:operation_target_name;type:varchar"` // smae as app name or components display name
	OperationBroadcastType    string             `json:"operationBroadcastType"    gorm:"column:operation_broadcast_type;type:varchar"`
	OperationBroadcastPayload interface{}        `json:"operationBroadcastPayload" gorm:"column:operation_broadcast_payload;type:varchar"`
	OperationTargetModifiedAt time.Time          `json:"operationTargetModifiedAt" gorm:"column:operation_target_modified_at;type:timestamp"`
	ModifiedBy                *UserForModifiedBy `json:"modifiedBy" 		       gorm:"column:modified_by;type:timestamp"`
	ModifiedAt                time.Time          `json:"modifiedAt" 		       gorm:"column:modified_at;type:timestamp"`
}

func NewAppModifyHistoryForExport

func NewAppModifyHistoryForExport(appModifyHistory *AppModifyHistory, usersLT map[int]*User) *AppModifyHistoryForExport

type AppSnapshot

type AppSnapshot struct {
	ID            int       `json:"id" 						gorm:"column:id;type:bigserial;primary_key;unique"`
	UID           uuid.UUID `json:"uid"   		   			gorm:"column:uid;type:uuid;not null"`
	TeamID        int       `json:"teamID" 		   			gorm:"column:team_id;type:bigserial"`
	AppRefID      int       `json:"appID" 		    		gorm:"column:app_ref_id;type:bigserial"`
	TargetVersion int       `json:"targetVersion" 			gorm:"column:target_version;type:bigserial"`
	TriggerMode   int       `json:"snapshotTriggerMode"     gorm:"column:trigger_mode;type:smallint"`
	ModifyHistory string    `json:"modifyHistory" 			gorm:"column:modify_history;type:jsonb"`
	CreatedAt     time.Time `json:"createdAt" 				gorm:"column:created_at;type:timestamp"`
}

func NewAppSnapshot

func NewAppSnapshot(teamID int, appID int, targetVersion int, triggerMode int) *AppSnapshot

func (*AppSnapshot) DoesActiveSnapshotNeedArchive

func (appSnapshot *AppSnapshot) DoesActiveSnapshotNeedArchive() bool

func (*AppSnapshot) ExportCreatedAt

func (appSnapshot *AppSnapshot) ExportCreatedAt() time.Time

func (*AppSnapshot) ExportModifyHistory

func (appSnapshot *AppSnapshot) ExportModifyHistory() []*AppModifyHistory

func (*AppSnapshot) ExportTargetVersion

func (appSnapshot *AppSnapshot) ExportTargetVersion() int

func (*AppSnapshot) ImportModifyHistory

func (appSnapshot *AppSnapshot) ImportModifyHistory(appModifyHistorys []*AppModifyHistory)

func (*AppSnapshot) InitCreatedAt

func (appSnapshot *AppSnapshot) InitCreatedAt()

func (*AppSnapshot) InitModifyHistory

func (appSnapshot *AppSnapshot) InitModifyHistory()

func (*AppSnapshot) InitUID

func (appSnapshot *AppSnapshot) InitUID()

func (*AppSnapshot) PushModifyHistory

func (appSnapshot *AppSnapshot) PushModifyHistory(currentAppModifyHistory *AppModifyHistory)

func (*AppSnapshot) SetTargetVersion

func (appSnapshot *AppSnapshot) SetTargetVersion(targetVersion int)

func (*AppSnapshot) SetTriggerMode

func (appSnapshot *AppSnapshot) SetTriggerMode(triggerMode int)

func (*AppSnapshot) SetTriggerModeAuto

func (appSnapshot *AppSnapshot) SetTriggerModeAuto()

func (*AppSnapshot) SetTriggerModeManual

func (appSnapshot *AppSnapshot) SetTriggerModeManual()

type AppSnapshotForExport

type AppSnapshotForExport struct {
	ID            string                       `json:"snapshotID"`
	TeamID        string                       `json:"teamID"`
	AppRefID      string                       `json:"appID"`
	TargetVersion int                          `json:"targetVersion"`
	TriggerMode   int                          `json:"snapshotTriggerMode"`
	ModifyHistory []*AppModifyHistoryForExport `json:"modifyHistory"`
	CreatedAt     time.Time                    `json:"createdAt"`
}

func NewAppSnapshotForExport

func NewAppSnapshotForExport(appSnapshot *AppSnapshot, usersLT map[int]*User) *AppSnapshotForExport

type ComponentNode

type ComponentNode struct {
	Version       float64                `json:"version"` // default is 0
	DisplayName   string                 `json:"displayName"`
	ParentNode    string                 `json:"parentNode"`
	ShowName      string                 `json:"showName"`
	ChildrenNode  []*ComponentNode       `json:"childrenNode"`
	Type          string                 `json:"type"`
	ContainerType string                 `json:"containerType"`
	H             float64                `json:"h"`
	W             float64                `json:"w"`
	MinH          float64                `json:"minH"`
	MinW          float64                `json:"minW"`
	X             float64                `json:"x"`
	Y             float64                `json:"y"`
	Z             float64                `json:"z"`
	Props         map[string]interface{} `json:"props"`
}

func BuildComponentTree

func BuildComponentTree(treeState *TreeState, treeStateMap map[int]*TreeState, parentComponentNode *ComponentNode, dagNodeMarkTable map[int]bool) (*ComponentNode, error)

func ConstructComponentNodeByMap

func ConstructComponentNodeByMap(data interface{}) *ComponentNode

func NewComponentNode

func NewComponentNode() *ComponentNode

func NewComponentNodeFromJSON

func NewComponentNodeFromJSON(cnodebyte []byte) (*ComponentNode, error)

func (*ComponentNode) AppendChildrenNode

func (cnode *ComponentNode) AppendChildrenNode(node *ComponentNode)

func (*ComponentNode) Serialization

func (cnode *ComponentNode) Serialization() ([]byte, error)

func (*ComponentNode) SerializationForDatabase

func (cnode *ComponentNode) SerializationForDatabase() (string, error)

func (*ComponentNode) UpdateParentNode

func (cnode *ComponentNode) UpdateParentNode(parentComponentNode *ComponentNode)

type ComponentStateForUpdate

type ComponentStateForUpdate struct {
	Before interface{} `json:"before"`
	After  interface{} `json:"after"`
}

func ConstructComponentStateForUpdateByPayload

func ConstructComponentStateForUpdateByPayload(data interface{}) (*ComponentStateForUpdate, error)

type DisplayNameState

type DisplayNameState []string

func ResolveDisplayNameStateByPayload

func ResolveDisplayNameStateByPayload(data interface{}) (DisplayNameState, error)

type DisplayNameStateForUpdate

type DisplayNameStateForUpdate struct {
	Before string `json:"before"`
	After  string `json:"after"`
}

func ConstructDisplayNameStateForUpdateByPayload

func ConstructDisplayNameStateForUpdateByPayload(data interface{}) (*DisplayNameStateForUpdate, error)

type FlowAction

type FlowAction struct {
	ID          int                    `gorm:"column:id;type:bigserial;primary_key"`
	UID         uuid.UUID              `gorm:"column:uid;type:uuid;not null"`
	TeamID      int                    `gorm:"column:team_id;type:bigserial"`
	WorkflowID  int                    `gorm:"column:workflow_id;type:bigint;not null"`
	Version     int                    `gorm:"column:version;type:bigint;not null"`
	ResourceID  int                    `gorm:"column:resource_id;type:bigint;not null"`
	Name        string                 `gorm:"column:name;type:varchar;size:255;not null"`
	Type        int                    `gorm:"column:type;type:smallint;not null"`
	TriggerMode string                 `gorm:"column:trigger_mode;type:varchar;size:16;not null"`
	Transformer string                 `gorm:"column:transformer;type:jsonb"`
	Template    string                 `gorm:"column:template;type:jsonb"`
	RawTemplate string                 `gorm:"-" sql:"-"`
	Context     map[string]interface{} `gorm:"-" sql:"-"`
	Config      string                 `gorm:"column:config;type:jsonb"`
	CreatedAt   time.Time              `gorm:"column:created_at;type:timestamp;not null"`
	CreatedBy   int                    `gorm:"column:created_by;type:bigint;not null"`
	UpdatedAt   time.Time              `gorm:"column:updated_at;type:timestamp;not null"`
	UpdatedBy   int                    `gorm:"column:updated_by;type:bigint;not null"`
}

func NewFlowAcitonByCreateFlowActionRequest

func NewFlowAcitonByCreateFlowActionRequest(teamID int, workflowID int, userID int, req *request.CreateFlowActionRequest) (*FlowAction, error)

func NewFlowAcitonByRunFlowActionRequest

func NewFlowAcitonByRunFlowActionRequest(teamID int, workflowID int, userID int, req *request.RunFlowActionRequest) *FlowAction

func NewFlowAcitonByUpdateFlowActionRequest

func NewFlowAcitonByUpdateFlowActionRequest(teamID int, workflowID int, userID int, req *request.UpdateFlowActionRequest) (*FlowAction, error)

func NewFlowAction

func NewFlowAction() *FlowAction

func (*FlowAction) AppendNewVersion

func (action *FlowAction) AppendNewVersion(newVersion int)

func (*FlowAction) AppendRuntimeInfoForVirtualResource

func (action *FlowAction) AppendRuntimeInfoForVirtualResource(authorization string, teamID int)

the action runtime does not pass the env info for virtual resource, so add them.

func (*FlowAction) CleanID

func (action *FlowAction) CleanID()

func (*FlowAction) ExportConfig

func (action *FlowAction) ExportConfig() *FlowActionConfig

func (*FlowAction) ExportConfigInMap

func (action *FlowAction) ExportConfigInMap() map[string]interface{}

func (*FlowAction) ExportDisplayName

func (action *FlowAction) ExportDisplayName() string

func (*FlowAction) ExportID

func (action *FlowAction) ExportID() int

func (*FlowAction) ExportIcon

func (action *FlowAction) ExportIcon() string

func (*FlowAction) ExportRawTemplateInMap

func (action *FlowAction) ExportRawTemplateInMap() map[string]interface{}

func (*FlowAction) ExportResourceID

func (action *FlowAction) ExportResourceID() int

func (*FlowAction) ExportTemplateInMap

func (action *FlowAction) ExportTemplateInMap() map[string]interface{}

func (*FlowAction) ExportTransformerInMap

func (action *FlowAction) ExportTransformerInMap() map[string]interface{}

func (*FlowAction) ExportType

func (action *FlowAction) ExportType() int

func (*FlowAction) ExportTypeInString

func (action *FlowAction) ExportTypeInString() string

func (*FlowAction) InitCreatedAt

func (action *FlowAction) InitCreatedAt()

func (*FlowAction) InitForFork

func (action *FlowAction) InitForFork(teamID int, workflowID int, version int, userID int)

func (*FlowAction) InitUID

func (action *FlowAction) InitUID()

func (*FlowAction) InitUpdatedAt

func (action *FlowAction) InitUpdatedAt()

func (*FlowAction) IsLocalVirtualFlowAction

func (action *FlowAction) IsLocalVirtualFlowAction() bool

func (*FlowAction) IsRemoteVirtualFlowAction

func (action *FlowAction) IsRemoteVirtualFlowAction() bool

func (*FlowAction) IsVirtualFlowAction

func (action *FlowAction) IsVirtualFlowAction() bool

func (*FlowAction) MergeRunFlowActionContextToRawTemplate

func (action *FlowAction) MergeRunFlowActionContextToRawTemplate(context map[string]interface{})

func (*FlowAction) SetContextByMap

func (action *FlowAction) SetContextByMap(context map[string]interface{})

func (*FlowAction) SetResourceIDByAiAgent

func (action *FlowAction) SetResourceIDByAiAgent(aiAgent *kozmoresourcemanagersdk.AIAgentForExport)

func (*FlowAction) SetTemplate

func (action *FlowAction) SetTemplate(tempalte interface{})

func (*FlowAction) UpdateAppConfig

func (action *FlowAction) UpdateAppConfig(actionConfig *FlowActionConfig, userID int)

func (*FlowAction) UpdateFlowAcitonByUpdateFlowActionRequest

func (action *FlowAction) UpdateFlowAcitonByUpdateFlowActionRequest(teamID int, workflowID int, userID int, req *request.UpdateFlowActionRequest)

func (*FlowAction) UpdateWithRunFlowActionRequest

func (action *FlowAction) UpdateWithRunFlowActionRequest(req *request.RunFlowActionRequest, userID int)

type FlowActionConfig

type FlowActionConfig struct {
	IsVirtualResource  bool                `json:"isVirtualResource"`
	FlowAdvancedConfig *FlowAdvancedConfig `json:"advancedConfig"` // 2023_4_20: add advanced config for action
	FlowMockConfig     *FlowMockConfig     `json:"mockConfig"`
}

func NewFlowActionConfig

func NewFlowActionConfig() *FlowActionConfig

func (*FlowActionConfig) ExportToJSONString

func (ac *FlowActionConfig) ExportToJSONString() string

func (*FlowActionConfig) SetIsNotVirtualResource

func (ac *FlowActionConfig) SetIsNotVirtualResource()

func (*FlowActionConfig) SetIsVirtualResource

func (ac *FlowActionConfig) SetIsVirtualResource()

type FlowAdvancedConfig

type FlowAdvancedConfig struct {
	Runtime            string   `json:"runtime"`
	Pages              []string `json:"pages"`
	DelayWhenLoaded    string   `json:"delayWhenLoaded"`
	DisplayLoadingPage bool     `json:"displayLoadingPage"`
	IsPeriodically     bool     `json:"isPeriodically"`
	PeriodInterval     string   `json:"periodInterval"`
	Mock               string   `json:"mock"`
}

type FlowMockConfig

type FlowMockConfig struct {
	Enabled  bool   `json:"enabled"`
	MockData string `json:"mockData"`
}

type FullAppForExport

type FullAppForExport struct {
	AppInfo               *AppForExport          `json:"appInfo"`
	Actions               []*ActionForExport     `json:"actions"`
	Components            *ComponentNode         `json:"components"`
	DependenciesState     map[string][]string    `json:"dependenciesState"`
	DragShadowState       map[string]interface{} `json:"dragShadowState"`
	DottedLineSquareState map[string]interface{} `json:"dottedLineSquareState"`
	DisplayNameState      []string               `json:"displayNameState"`
}

func NewFullAppForExport

func NewFullAppForExport(appInfo *AppForExport, actions []*ActionForExport, components *ComponentNode, dependenciesState map[string][]string, dragShadowState map[string]interface{}, dottedLineSquareState map[string]interface{}, displayNameState []string) *FullAppForExport

func (*FullAppForExport) ExportAppName

func (resp *FullAppForExport) ExportAppName() string

func (*FullAppForExport) ExportForFeedback

func (resp *FullAppForExport) ExportForFeedback() interface{}

type GoogleSheetsOAuth2Claims

type GoogleSheetsOAuth2Claims struct {
	Team     int    `json:"team"`
	User     int    `json:"user"`
	Resource int    `json:"resource"`
	Access   int    `json:"access"`
	URL      string `json:"url"`
	jwt.RegisteredClaims
}

func NewGoogleSheetsOAuth2Claims

func NewGoogleSheetsOAuth2Claims() *GoogleSheetsOAuth2Claims

func (*GoogleSheetsOAuth2Claims) ExtractGoogleSheetsOAuth2TokenInfo

func (i *GoogleSheetsOAuth2Claims) ExtractGoogleSheetsOAuth2TokenInfo(accessToken string) (teamID, userID, resourceID int, url string, err error)

func (*GoogleSheetsOAuth2Claims) ValidateAccessToken

func (i *GoogleSheetsOAuth2Claims) ValidateAccessToken(accessToken string) (int, error)

type GoogleSheetsOAuth2Options

type GoogleSheetsOAuth2Options struct {
	AccessType   string `json:"accessType"`
	AccessToken  string `json:"accessToken"`
	TokenType    string `json:"tokenType"`
	RefreshToken string `json:"refreshToken"`
	Status       int    `json:"status"`
	ExpiresIn    int    `json:"expiresIn"`
	Scope        string `json:"scope"`
}

type KVState

type KVState struct {
	ID        int       `json:"id" 		   gorm:"column:id;type:bigserial"`
	UID       uuid.UUID `json:"uid" 	   gorm:"column:uid;type:uuid;not null"`
	TeamID    int       `json:"teamID"    gorm:"column:team_id;type:bigserial"`
	StateType int       `json:"state_type" gorm:"column:state_type;type:bigint"`
	AppRefID  int       `json:"app_ref_id" gorm:"column:app_ref_id;type:bigint"`
	Version   int       `json:"version"    gorm:"column:version;type:bigint"`
	Key       string    `json:"key" 	   gorm:"column:key;type:text"`
	Value     string    `json:"value" 	   gorm:"column:value;type:jsonb"`
	CreatedAt time.Time `json:"created_at" gorm:"column:created_at;type:timestamp"`
	CreatedBy int       `json:"created_by" gorm:"column:created_by;type:bigint"`
	UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at;type:timestamp"`
	UpdatedBy int       `json:"updated_by" gorm:"column:updated_by;type:bigint"`
}

func NewKVStateByApp

func NewKVStateByApp(app *App, stateType int) *KVState

func NewKVStateByWebsocketMessage

func NewKVStateByWebsocketMessage(app *App, stateType int, data interface{}) (*KVState, error)

func NewKVStateByWebsocketMessageWithGivenKey

func NewKVStateByWebsocketMessageWithGivenKey(app *App, stateType int, key string, data interface{}) (*KVState, error)

func (*KVState) AppendNewVersion

func (kvState *KVState) AppendNewVersion(newVersion int)

func (*KVState) CleanID

func (kvState *KVState) CleanID()

func (*KVState) ExportID

func (kvState *KVState) ExportID() int

func (*KVState) ExportKey

func (kvState *KVState) ExportKey() string

func (*KVState) ExportVersion

func (kvState *KVState) ExportVersion() int

func (*KVState) InitCreatedAt

func (kvState *KVState) InitCreatedAt()

func (*KVState) InitForFork

func (kvState *KVState) InitForFork(teamID int, appID int, version int, userID int)

func (*KVState) InitUID

func (kvState *KVState) InitUID()

func (*KVState) InitUpdatedAt

func (kvState *KVState) InitUpdatedAt()

func (*KVState) UpdateByNewKVState

func (kvState *KVState) UpdateByNewKVState(newKVState *KVState)

type MockConfig

type MockConfig struct {
	Enabled              bool   `json:"enabled"`
	MockData             string `json:"mockData"`
	EnableForReleasedApp bool   `json:"enableForReleasedApp"`
}

type Pagination

type Pagination struct {
	Limit      int         `json:"limit,omitempty;query:limit"`
	Page       int         `json:"page,omitempty;query:page"`
	Sort       string      `json:"sort,omitempty;query:sort"`
	TotalRows  int64       `json:"total_rows"`
	TotalPages int         `json:"total_pages"`
	Rows       interface{} `json:"rows"`
}

func NewPagiNation

func NewPagiNation(limit int, page int) *Pagination

func (*Pagination) CalculateTotalPagesByTotalRows

func (p *Pagination) CalculateTotalPagesByTotalRows(totalRows int64)

func (*Pagination) GetLimit

func (p *Pagination) GetLimit() int

func (*Pagination) GetOffset

func (p *Pagination) GetOffset() int

func (*Pagination) GetPage

func (p *Pagination) GetPage() int

func (*Pagination) GetSort

func (p *Pagination) GetSort() string

func (*Pagination) GetTotalPages

func (p *Pagination) GetTotalPages() int

func (*Pagination) GetTotalRows

func (p *Pagination) GetTotalRows() int64

func (*Pagination) SetSort

func (p *Pagination) SetSort(field string, vec string)

func (*Pagination) SetTotalRows

func (p *Pagination) SetTotalRows(totalRows int64)

type RawTeam

type RawTeam struct {
	ID         string    `json:"id"`
	UID        uuid.UUID `json:"uid"`
	Name       string    `json:"name"`
	Identifier string    `json:"identifier"`
	Icon       string    `json:"icon"`
	Permission string    `json:"permission"` // for team permission config
	CreatedAt  time.Time ``
	UpdatedAt  time.Time ``
}

type RawUser

type RawUser struct {
	ID             string    `json:"id" gorm:"column:id;type:bigserial;primary_key;index:users_ukey"`
	UID            uuid.UUID `json:"uid" gorm:"column:uid;type:uuid;not null;index:users_ukey"`
	Nickname       string    `json:"nickname" gorm:"column:nickname;type:varchar;size:15"`
	PasswordDigest string    `json:"passworddigest" gorm:"column:password_digest;type:varchar;size:60;not null"`
	Email          string    `json:"email" gorm:"column:email;type:varchar;size:255;not null"`
	Avatar         string    `json:"avatar" gorm:"column:avatar;type:varchar;size:255;not null"`
	SSOConfig      string    `json:"SSOConfig" gorm:"column:sso_config;type:jsonb"`        // for single sign-on data
	Customization  string    `json:"customization" gorm:"column:customization;type:jsonb"` // for user itself customization config, including: Language, IsSubscribed
	CreatedAt      time.Time `gorm:"column:created_at;type:timestamp"`
	UpdatedAt      time.Time `gorm:"column:updated_at;type:timestamp"`
}

type RawUsers

type RawUsers struct {
	Users map[string]*RawUser `json:"users"`
}

type Resource

type Resource struct {
	ID        int       `gorm:"column:id;type:bigserial;primary_key"`
	UID       uuid.UUID `gorm:"column:uid;type:uuid;not null"`
	TeamID    int       `gorm:"column:team_id;type:bigserial"`
	Name      string    `gorm:"column:name;type:varchar;size:200;not null"`
	Type      int       `gorm:"column:type;type:smallint;not null"`
	Options   string    `gorm:"column:options;type:jsonb"`
	CreatedAt time.Time `gorm:"column:created_at;type:timestamp;not null"`
	CreatedBy int       `gorm:"column:created_by;type:bigint;not null"`
	UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;not null"`
	UpdatedBy int       `gorm:"column:updated_by;type:bigint;not null"`
}

func NewResource

func NewResource() *Resource

func NewResourceByCreateResourceRequest

func NewResourceByCreateResourceRequest(teamID int, userID int, req *request.CreateResourceRequest) *Resource

func NewResourceByTestResourceConnectionRequest

func NewResourceByTestResourceConnectionRequest(teamID int, userID int, req *request.TestResourceConnectionRequest) *Resource

func (*Resource) CanCreateOAuthToken

func (resource *Resource) CanCreateOAuthToken() bool

func (*Resource) CleanID

func (resource *Resource) CleanID()

func (*Resource) ExportOptionsInMap

func (resource *Resource) ExportOptionsInMap() map[string]interface{}

func (*Resource) ExportType

func (resource *Resource) ExportType() int

func (*Resource) ExportTypeInString

func (resource *Resource) ExportTypeInString() string

func (*Resource) ExportUpdatedAt

func (resource *Resource) ExportUpdatedAt() time.Time

func (*Resource) InitCreatedAt

func (resource *Resource) InitCreatedAt()

func (*Resource) InitUID

func (resource *Resource) InitUID()

func (*Resource) InitUpdatedAt

func (resource *Resource) InitUpdatedAt()

func (*Resource) UpdateByUpdateResourceRequest

func (resource *Resource) UpdateByUpdateResourceRequest(userID int, req *request.UpdateResourceRequest)

func (*Resource) UpdateGoogleSheetOAuth2Options

func (resource *Resource) UpdateGoogleSheetOAuth2Options(userID int, options *ResourceOptionGoogleSheets)

type ResourceForExport

type ResourceForExport struct {
	ID        string                 `json:"resourceID"`
	UID       uuid.UUID              `json:"uid"`
	TeamID    string                 `json:"teamID"`
	Name      string                 `json:"resourceName" validate:"required"`
	Type      string                 `json:"resourceType" validate:"required"`
	Options   map[string]interface{} `json:"content" validate:"required"`
	CreatedAt time.Time              `json:"createdAt,omitempty"`
	CreatedBy string                 `json:"createdBy,omitempty"`
	UpdatedAt time.Time              `json:"updatedAt,omitempty"`
	UpdatedBy string                 `json:"updatedBy,omitempty"`
}

func BatchNewResourceForExport

func BatchNewResourceForExport(r []*Resource) []*ResourceForExport

func NewResourceForExport

func NewResourceForExport(r *Resource) *ResourceForExport

func NewResourceForExportByMap

func NewResourceForExportByMap(data interface{}) (*ResourceForExport, error)

func (*ResourceForExport) ExportForFeedback

func (resp *ResourceForExport) ExportForFeedback() interface{}

func (*ResourceForExport) ExportName

func (resp *ResourceForExport) ExportName() string

func (*ResourceForExport) ExportOptionsInString

func (resp *ResourceForExport) ExportOptionsInString() string

type ResourceOptionGoogleSheets

type ResourceOptionGoogleSheets struct {
	Authentication string                     `json:"authentication"`
	Options        *GoogleSheetsOAuth2Options `json:"opts"`
}

func NewResourceOptionGoogleSheetsByResource

func NewResourceOptionGoogleSheetsByResource(resource *Resource) (*ResourceOptionGoogleSheets, error)

func (*ResourceOptionGoogleSheets) ExportInString

func (i *ResourceOptionGoogleSheets) ExportInString() string

func (*ResourceOptionGoogleSheets) ExportRefreshToken

func (i *ResourceOptionGoogleSheets) ExportRefreshToken() string

func (*ResourceOptionGoogleSheets) IsAvaliableAuthenticationMethod

func (i *ResourceOptionGoogleSheets) IsAvaliableAuthenticationMethod() bool

func (*ResourceOptionGoogleSheets) SetAccessToken

func (i *ResourceOptionGoogleSheets) SetAccessToken(accessToken string)

func (*ResourceOptionGoogleSheets) UpdateByExchangeTokenResponse

func (i *ResourceOptionGoogleSheets) UpdateByExchangeTokenResponse(repo *oauthgoogle.ExchangeTokenResponse)

type SetState

type SetState struct {
	ID        int       `json:"id" 		   gorm:"column:id;type:bigserial"`
	UID       uuid.UUID `json:"uid" 	   gorm:"column:uid;type:uuid;not null"`
	TeamID    int       `json:"teamID"    gorm:"column:team_id;type:bigserial"`
	StateType int       `json:"state_type" gorm:"column:state_type;type:bigint"`
	AppRefID  int       `json:"app_ref_id" gorm:"column:app_ref_id;type:bigint"`
	Version   int       `json:"version"    gorm:"column:version;type:bigint"`
	Value     string    `json:"value" 	   gorm:"column:value;type:text"`
	CreatedAt time.Time `json:"created_at" gorm:"column:created_at;type:timestamp"`
	CreatedBy int       `json:"created_by" gorm:"column:created_by;type:bigint"`
	UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at;type:timestamp"`
	UpdatedBy int       `json:"updated_by" gorm:"column:updated_by;type:bigint"`
}

func NewSetStateByApp

func NewSetStateByApp(app *App, stateType int) *SetState

func NewSetStateByWebsocketMessage

func NewSetStateByWebsocketMessage(app *App, stateType int, data interface{}) (*SetState, error)

func (*SetState) AppendNewVersion

func (setState *SetState) AppendNewVersion(newVersion int)

func (*SetState) CleanID

func (setState *SetState) CleanID()

func (*SetState) ExportID

func (setState *SetState) ExportID() int

func (*SetState) ExportValue

func (setState *SetState) ExportValue() string

func (*SetState) ExportVersion

func (setState *SetState) ExportVersion() int

func (*SetState) InitCreatedAt

func (setState *SetState) InitCreatedAt()

func (*SetState) InitForFork

func (setState *SetState) InitForFork(teamID int, appID int, version int, userID int)

func (*SetState) InitUID

func (setState *SetState) InitUID()

func (*SetState) InitUpdatedAt

func (setState *SetState) InitUpdatedAt()

func (*SetState) UpdateByNewSetState

func (setState *SetState) UpdateByNewSetState(newSetState *SetState)

type Team

type Team struct {
	ID         int       `json:"id"`
	UID        uuid.UUID `json:"uid"`
	Name       string    `json:"name"`
	Identifier string    `json:"identifier"`
	Icon       string    `json:"icon"`
	Permission string    `json:"permission"` // for team permission config
	CreatedAt  time.Time ``
	UpdatedAt  time.Time ``
}

func NewTeam

func NewTeam(u *RawTeam) *Team

func NewTeamByDataControlRawData

func NewTeamByDataControlRawData(rawTeamString string) (*Team, error)

func (*Team) ExportIDInString

func (u *Team) ExportIDInString() string

func (*Team) ExportUID

func (u *Team) ExportUID() uuid.UUID

func (*Team) ExportUIDInString

func (u *Team) ExportUIDInString() string

func (*Team) GetID

func (u *Team) GetID() int

type TreeState

type TreeState struct {
	ID                 int       `json:"id" 							 gorm:"column:id;type:bigserial"`
	UID                uuid.UUID `json:"uid" 							 gorm:"column:uid;type:uuid;not null"`
	TeamID             int       `json:"teamID" 						 gorm:"column:team_id;type:bigserial"`
	StateType          int       `json:"state_type" 					 gorm:"column:state_type;type:bigint"`
	ParentNode         string    `json:"parentNode" sql:"-" gorm:"-"`
	ParentNodeRefID    int       `json:"parent_node_ref_id" 			 gorm:"column:parent_node_ref_id;type:bigint"`
	ChildrenNodeRefIDs string    `json:"children_node_ref_ids" 		     gorm:"column:children_node_ref_ids;type:jsonb"`
	AppRefID           int       `json:"app_ref_id" 					 gorm:"column:app_ref_id;type:bigint"`
	Version            int       `json:"version" 					     gorm:"column:version;type:bigint"`
	Name               string    `json:"name" 						     gorm:"column:name;type:text"`
	Content            string    `json:"content"    					 gorm:"column:content;type:jsonb"`
	CreatedAt          time.Time `json:"created_at" 					 gorm:"column:created_at;type:timestamp"`
	CreatedBy          int       `json:"created_by" 					 gorm:"column:created_by;type:bigint"`
	UpdatedAt          time.Time `json:"updated_at" 					 gorm:"column:updated_at;type:timestamp"`
	UpdatedBy          int       `json:"updated_by" 					 gorm:"column:updated_by;type:bigint"`
}

func NewTreeState

func NewTreeState() *TreeState

func NewTreeStateByApp

func NewTreeStateByApp(app *App, stateType int) *TreeState

func NewTreeStateByAppAndComponentState

func NewTreeStateByAppAndComponentState(app *App, stateType int, componentNode *ComponentNode) (*TreeState, error)

func NewTreeStateByDeleteComponentsWebsocketMessage

func NewTreeStateByDeleteComponentsWebsocketMessage(app *App, stateType int, data interface{}) (*TreeState, error)

delete component tree, message like:

{
    "signal": 4,
    "target": 1,
    "option": 1,
    "broadcast": {
        "type": "components/deleteComponentNodeReducer",
        "payload": {
            "displayNames": [
                "image1"
            ],
            "source": "manage_delete"
        }
    },
    "payload": [
        "image1" <- data
    ],
    "teamID": "ILAfx4p1C7bN",
    "uid": "ILAfx4p1C7bN"
}

func NewTreeStateByMoveStateWebsocketMessage

func NewTreeStateByMoveStateWebsocketMessage(app *App, stateType int, data interface{}) (*TreeState, error)

data sample:

{
    "signal": 6,
    "target": 1,
    "option": 1,
    "broadcast": {
        "type": "components/updateComponentContainerReducer",
        "payload": {
            "oldParentNodeDisplayName": "bodySection1-bodySectionContainer1",
            "newParentNodeDisplayName": "canvas1",
            "updateSlices": [
                {
                    "displayName": "text1",
                    "x": 8,
                    "y": 4,
                    "w": 20,
                    "h": 5
                }
            ]
        }
    },
    "payload": [
        {
            "displayName": "text1",
            "parentNode": "canvas1",
            "childrenNode": null
        }
    ],
    "teamID": "ILAfx4p1C7dL",
    "uid": "ILAfx4p1C7dL"
}

func NewTreeStateByTeamIDAndStateType

func NewTreeStateByTeamIDAndStateType(teamID int, stateType int) *TreeState

func NewTreeStateByWebsocketMessage

func NewTreeStateByWebsocketMessage(app *App, stateType int, data interface{}) (*TreeState, error)

data sample: ------------------------

                                   |
	{                              |
	    "signal": 5,               |
	    "target": 1,               |
	    "option": 0,               |
	    "broadcast": null,         |
	    "payload": [               |
	        {                      ↓
	            "before": { <- data
	                "displayName": "input1"
	            },                 ↓
	            "after": {  <- data
	                "w": 6,
	                "h": 5,
	                "minW": 1,
	                "minH": 3,
	                "x": 19,
	                "y": 22,
	                "z": 0,
	                "showName": "input",
	                "type": "INPUT_WIDGET",
	                "displayName": "input1",
	                "containerType": "EDITOR_SCALE_SQUARE",
	                "parentNode": "bodySection1-bodySectionContainer1",
	                "childrenNode": [],
	                "props": {
	                    "value": "",
	                    "label": "Label",
	                    "labelAlign": "left",
	                    "labelPosition": "left",
	                    "labelWidth": "{{33}}",
	                    "colorScheme": "blue",
	                    "hidden": false,
	                    "formDataKey": "{{input1.displayName}}",
	                    "placeholder": "input sth",
	                    "$dynamicAttrPaths": [
	                        "labelWidth",
	                        "formDataKey",
	                        "showVisibleButton"
	                    ],
	                    "type": "input",
	                    "showVisibleButton": "{{true}}"
	                },
	                "version": 0
	            }
	        }
	    ],
	    "teamID": "ILAfx4p1C7bN",
	    "uid": "ILAfx4p1C7bN"
	}

func PickUpTreeStatesRootNode

func PickUpTreeStatesRootNode(treeStates []*TreeState) *TreeState

func (*TreeState) AppendChildrenNodeRefIDs

func (treeState *TreeState) AppendChildrenNodeRefIDs(targetIDs []int) error

func (*TreeState) AppendNewVersion

func (treeState *TreeState) AppendNewVersion(newVersion int)

func (*TreeState) CleanID

func (treeState *TreeState) CleanID()

func (*TreeState) ExportChildrenNodeRefIDs

func (treeState *TreeState) ExportChildrenNodeRefIDs() ([]int, error)

func (*TreeState) ExportContentAsComponentState

func (treeState *TreeState) ExportContentAsComponentState() (*ComponentNode, error)

func (*TreeState) ExportID

func (treeState *TreeState) ExportID() int

func (*TreeState) ExportName

func (treeState *TreeState) ExportName() string

func (*TreeState) ExportStateType

func (treeState *TreeState) ExportStateType() int

func (*TreeState) InitCreatedAt

func (treeState *TreeState) InitCreatedAt()

func (*TreeState) InitForFork

func (treeState *TreeState) InitForFork(teamID int, appID int, version int, userID int)

func (*TreeState) InitUID

func (treeState *TreeState) InitUID()

func (*TreeState) InitUpdatedAt

func (treeState *TreeState) InitUpdatedAt()

func (*TreeState) RemapChildrenNodeRefIDs

func (treeState *TreeState) RemapChildrenNodeRefIDs(idMap map[int]int)

func (*TreeState) RemoveChildrenNodeRefIDs

func (treeState *TreeState) RemoveChildrenNodeRefIDs(targetIDs []int) error

func (*TreeState) ResetChildrenNodeRefIDsByMap

func (treeState *TreeState) ResetChildrenNodeRefIDsByMap(idMap map[int]int)

reset children ids by idmap[oldID]newID

func (*TreeState) ResetParentNodeRefIDByMap

func (treeState *TreeState) ResetParentNodeRefIDByMap(idMap map[int]int)

reset parent id by idmap[oldID]newID

func (*TreeState) SetParentNodeRefID

func (treeState *TreeState) SetParentNodeRefID(id int)

func (*TreeState) SetTeamID

func (treeState *TreeState) SetTeamID(teamID int)

func (*TreeState) UpdateByNewTreeState

func (treeState *TreeState) UpdateByNewTreeState(newTreeState *TreeState)

func (*TreeState) UpdateNameAndContent

func (treeState *TreeState) UpdateNameAndContent(newTreeState *TreeState)

type User

type User struct {
	ID             int       `json:"id" gorm:"column:id;type:bigserial;primary_key;index:users_ukey"`
	UID            uuid.UUID `json:"uid" gorm:"column:uid;type:uuid;not null;index:users_ukey"`
	Nickname       string    `json:"nickname" gorm:"column:nickname;type:varchar;size:15"`
	PasswordDigest string    `json:"passworddigest" gorm:"column:password_digest;type:varchar;size:60;not null"`
	Email          string    `json:"email" gorm:"column:email;type:varchar;size:255;not null"`
	Avatar         string    `json:"avatar" gorm:"column:avatar;type:varchar;size:255;not null"`
	SSOConfig      string    `json:"SSOConfig" gorm:"column:sso_config;type:jsonb"`        // for single sign-on data
	Customization  string    `json:"customization" gorm:"column:customization;type:jsonb"` // for user itself customization config, including: Language, IsSubscribed
	CreatedAt      time.Time `gorm:"column:created_at;type:timestamp"`
	UpdatedAt      time.Time `gorm:"column:updated_at;type:timestamp"`
}

func NewInvaliedUser

func NewInvaliedUser() *User

func NewUser

func NewUser(u *RawUser) *User

func NewUserByDataControlRawData

func NewUserByDataControlRawData(rawUserString string) (*User, error)

func (*User) ExportIDToString

func (u *User) ExportIDToString() string

type UserForEditedBy

type UserForEditedBy struct {
	ID       string    `json:"userID"`
	Nickname string    `json:"nickname"`
	Email    string    `json:"email"`
	Avatar   string    `json:"avatar"`
	EditedAt time.Time `json:"editedAt"`
}

func NewUserForEditedBy

func NewUserForEditedBy(user *User, editedAt time.Time) *UserForEditedBy

type UserForModifiedBy

type UserForModifiedBy struct {
	ID       string `json:"userID"`
	Nickname string `json:"nickname"`
	Email    string `json:"email"`
	Avatar   string `json:"avatar"`
}

func NewUserForModifiedBy

func NewUserForModifiedBy(user *User) *UserForModifiedBy

type WebsocketConnectionInfo

type WebsocketConnectionInfo struct {
	Config                        *config.Config
	DefaultConnectionAddress      string
	SouthAsiaConnectionAddress    string
	EastAsiaConnectionAddress     string
	CenterEuropeConnectionAddress string
}

func NewWebsocketConnectionInfo

func NewWebsocketConnectionInfo(conf *config.Config) *WebsocketConnectionInfo

func (*WebsocketConnectionInfo) GetAppRoomBinaryConnectionAddress

func (i *WebsocketConnectionInfo) GetAppRoomBinaryConnectionAddress(teamID int, roomID int, zone string) string

func (*WebsocketConnectionInfo) GetAppRoomConnectionAddress

func (i *WebsocketConnectionInfo) GetAppRoomConnectionAddress(teamID int, roomID int, zone string) string

func (*WebsocketConnectionInfo) GetConnectionAddressByCountryCode

func (i *WebsocketConnectionInfo) GetConnectionAddressByCountryCode(countryCode string) string

func (*WebsocketConnectionInfo) GetDashboardConnectionAddress

func (i *WebsocketConnectionInfo) GetDashboardConnectionAddress(teamID int, zone string) string

Jump to

Keyboard shortcuts

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