entities

package
v0.0.0-...-8c2001a Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TargetAppTypeUserGroupApp    = "user_group_app"
	TargetAppTypeUserGroupAuth   = "user_group_auth"
	TargetAppTypeDataTableWidget = "datatable_widget"
	TargetAppTypeDataSheetWidget = "datasheet_widget"
	TargetAppTypeDomainWidget    = "domain_widget"
	TargetAppTypeDomainEditor    = "domain_editor"
)
View Source
const (
	TargetHookTypeDataTableHook = "datatable_hook"
	TargetHookTypeDataSheetHook = "datasheet_hook"
	TargetHookTypeDomainHook    = "domain_hook"
	TargetHookTypeStartUp       = "startup"
	TargetHookDomainEditor      = "domain_editor"
)

Variables

This section is empty.

Functions

func JSONDriverScan

func JSONDriverScan(target any, value any) error

func JSONDriverValue

func JSONDriverValue(val any) (driver.Value, error)

Types

type ActivityQuery

type ActivityQuery struct {
	Types       []string  `json:"types,omitempty"`
	UserId      string    `json:"user_id,omitempty"`
	BetweenTime [2]string `json:"between_time,omitempty"`
	Count       int64     `json:"count,omitempty"`
	Offset      int64     `json:"offset,omitempty"`
}

type Agent

type Agent struct {
	Id         string     `json:"id,omitempty" db:"id,omitempty"`
	Name       string     `json:"name,omitempty" db:"name,omitempty"`
	Type       string     `json:"type,omitempty" db:"type,omitempty"` // web, super_web, headless
	Executor   string     `json:"executor,omitempty" db:"executor,omitempty"`
	IfaceFile  string     `json:"iface_file,omitempty" db:"iface_file,omitempty"`
	EntryFile  string     `json:"entry_file,omitempty" db:"entry_file,omitempty"`
	WebEntry   string     `json:"web_entry,omitempty" db:"web_entry,omitempty"`
	WebScript  string     `json:"web_script,omitempty" db:"web_script,omitempty"`
	WebStyle   string     `json:"web_style,omitempty" db:"web_style,omitempty"`
	WebLoader  string     `json:"web_loader,omitempty" db:"web_loader,omitempty"`
	WebFiles   JsonStrMap `json:"web_files,omitempty" db:"web_files,omitempty"`
	ExtraMeta  JsonStrMap `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
	ModVersion int64      `json:"mod_version,omitempty" db:"mod_version,omitempty"`
	PlugId     string     `json:"plug_id,omitempty" db:"plug_id,omitempty"`
	TenantId   string     `json:"tenant_id,omitempty" db:"tenant_id,omitempty"`
}

type AgentExtension

type AgentExtension struct {
	Id        int64      `json:"id,omitempty" db:"id,omitempty"`
	Name      string     `json:"name,omitempty" db:"name,omitempty"`
	Plug      string     `json:"plug_id,omitempty" db:"plug_id,omitempty"`
	Agent     string     `json:"agent_id,omitempty" db:"agent_id,omitempty"`
	RefFile   string     `json:"ref_file,omitempty" db:"ref_file,omitempty"`
	BprintId  string     `json:"bprint_id,omitempty" db:"bprint_id,omitempty"`
	ExtraMeta JsonStrMap `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
	TenantId  string     `json:"tenant_id,omitempty" db:"tenant_id,omitempty"`
}
type AgentLink struct {
	Id        int64      `json:"id,omitempty" db:"id,omitempty"`
	Name      string     `json:"name,omitempty" db:"name,omitempty"`
	FromPlug  string     `json:"from_plug_id,omitempty" db:"from_plug_id,omitempty"`
	FromAgent string     `json:"from_agent_id,omitempty" db:"from_agent_id,omitempty"`
	ToPlug    string     `json:"to_plug_id,omitempty" db:"to_plug_id,omitempty"`
	ToAgent   string     `json:"to_agent_id,omitempty" db:"to_agent_id,omitempty"`
	ToHandler string     `json:"to_handler,omitempty" db:"to_handler,omitempty"`
	ExtraMeta JsonStrMap `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
	TenantId  string     `json:"tenant_id,omitempty" db:"tenant_id,omitempty"`
}

type AgentResource

type AgentResource struct {
	Slug       string `json:"slug,omitempty" db:"slug,omitempty"`
	PlugId     string `json:"plug_id,omitempty" db:"plug_id,omitempty"`
	AgentId    string `json:"agent_id,omitempty" db:"agent_id,omitempty"`
	ResourceId string `json:"resource_id,omitempty" db:"resource_id,omitempty"`
	Actions    string `json:"actions,omitempty" db:"actions,omitempty"`
	Policy     string `json:"policy,omitempty" db:"policy,omitempty"`
	TenantId   string `json:"tenant_id,omitempty" db:"tenant_id,omitempty"`
}

type BPrint

type BPrint struct {
	ID          string    `json:"id,omitempty" db:"id,omitempty"`
	Name        string    `json:"name,omitempty" db:"name,omitempty"`
	Slug        string    `json:"slug,omitempty" db:"slug,omitempty"`
	Type        string    `json:"type,omitempty" db:"type,omitempty"`
	SubType     string    `json:"sub_type,omitempty" db:"sub_type,omitempty"`
	Description string    `json:"description,omitempty" db:"description,omitempty"`
	Icon        string    `json:"icon,omitempty" db:"icon,omitempty"`
	Source      string    `json:"source,omitempty" db:"source,omitempty"`
	TenantID    string    `json:"tenant_id,omitempty" db:"tenant_id,omitempty"`
	Tags        JsonArray `json:"tags,omitempty" db:"tags,omitempty"`
	Files       JsonArray `json:"files,omitempty" db:"files,omitempty"`
	ExtraMeta   JsonMap   `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
}

type BlobReference

type BlobReference struct {
	BlobHash string `json:"blob_hash,omitempty" db:"blob_hash,omitempty"`
	TenantID string `json:"tenant_id,omitempty" db:"tenant_id,omitempty"`
}

type Column

type Column struct {
	Name          string         `json:"name,omitempty" db:"name"`
	Slug          string         `json:"slug,omitempty" db:"slug"`
	Ctype         string         `json:"ctype,omitempty" db:"ctype"`
	Description   string         `json:"description,omitempty" db:"description"`
	Icon          string         `json:"icon,omitempty" db:"icon"`
	Options       pq.StringArray `json:"options" db:"options"`
	OrderID       int64          `json:"order_id,omitempty" db:"order_id"`
	Pattern       string         `json:"pattern,omitempty" db:"pattern"`
	StrictPattern bool           `json:"strict_pattern,omitempty" db:"strict_pattern"`
	RefId         string         `json:"ref_id,omitempty" db:"ref_id"`
	RefType       string         `json:"ref_type,omitempty" db:"ref_type"`
	RefTarget     string         `json:"ref_target,omitempty" db:"ref_target"`
	RefObject     string         `json:"ref_object,omitempty" db:"ref_object"`
	RefCopy       string         `json:"ref_copy,omitempty" db:"ref_copy"`
	TableID       string         `json:"table_id,omitempty" db:"table_id"`
	GroupID       string         `json:"group_id,omitempty" db:"group_id"`
	TenantID      string         `json:"tenant_id,omitempty" db:"tenant_id"`
	ExtraMeta     JsonStrMap     `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
}

type ColumnFKRef

type ColumnFKRef struct {
	Slug     string   `json:"slug,omitempty" yaml:"slug,omitempty"`
	Type     string   `json:"type,omitempty" yaml:"type,omitempty"`
	Target   string   `json:"target,omitempty" yaml:"target,omitempty"`
	FromCols []string `json:"from_cols,omitempty" yaml:"from_cols,omitempty"`
	ToCols   []string `json:"to_cols,omitempty" yaml:"to_cols,omitempty"`
	RefCopy  string   `json:"ref_copy,omitempty" yaml:"ref_copy,omitempty"`
}

type ColumnPartial

type ColumnPartial struct {
	Name          string   `json:"name,omitempty" db:"name,omitempty"`
	Description   string   `json:"description,omitempty" db:"description,omitempty"`
	Icon          string   `json:"icon,omitempty" db:"icon,omitempty"`
	Ctype         string   `json:"ctype,omitempty" db:"ctype,omitempty"`
	Options       []string `json:"options" db:"options,omitempty"`
	OrderID       int64    `json:"order_id,omitempty" db:"order_id,omitempty"`
	Pattern       string   `json:"pattern,omitempty" db:"pattern,omitempty"`
	RefId         string   `json:"ref_id,omitempty" db:"ref_id,omitempty"`
	RefType       string   `json:"ref_type,omitempty" db:"ref_type,omitempty"`
	RefTarget     string   `json:"ref_target,omitempty" db:"ref_target,omitempty"`
	RefObject     string   `json:"ref_object,omitempty" db:"ref_object,omitempty"`
	StrictPattern bool     `json:"strict_pattern,omitempty" db:"strict_pattern,omitempty"`
	ExtraMeta     JsonMap  `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
}

type DCache

type DCache interface {
	GetTableCache(tenantId, group, table string) (*DTableCache, error)
	EvictTable(tenantId, group, table string)
	GetColumnCache(tenantId, group, table string) (map[string]*Column, error)
	EvictColumns(tenantId, group, table string)
}

type DTableCache

type DTableCache struct {
	TableSlug string
	GroupSlug string
	Model     *Table
	Columns   map[string]*Column
	Hooks     []*TargetHook
	Views     []*DataView
}

type DataView

type DataView struct {
	Id          int64        `json:"id,omitempty" db:"id,omitempty"`
	Name        string       `json:"name,omitempty" db:"name,omitempty"`
	Count       int64        `json:"count,omitempty" db:"count"`
	FilterConds *FilterConds `json:"filter_conds,omitempty" db:"filter_conds,omitempty"`
	Selects     []string     `json:"selects,omitempty" db:"selects"`
	MainColumn  string       `json:"main_column,omitempty" db:"main_column"`
	SearchTerm  string       `json:"search_term,omitempty" db:"search_term"`
	Tags        JsonStrMap   `json:"tags,omitempty" db:"tags,omitempty"`
	TableID     string       `json:"table_id,omitempty" db:"table_id"`
	GroupID     string       `json:"group_id,omitempty" db:"group_id"`
	TenantID    string       `json:"tenant_id,omitempty" db:"tenant_id"`
	ExtraMeta   JsonStrMap   `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
}

type DynActivity

type DynActivity struct {
	Id        int64        `json:"id,omitempty" db:"id,omitempty"`
	Type      string       `json:"type,omitempty" db:"type"`
	RowId     int64        `json:"row_id,omitempty" db:"row_id"`
	RowVerson int64        `json:"row_version,omitempty" db:"row_version"`
	InitSign  string       `json:"init_sign,omitempty" db:"init_sign,omitempty"`
	AltIdent  string       `json:"alt_ident,omitempty" db:"alt_ident,omitempty"`
	UserId    string       `json:"user_id,omitempty" db:"user_id,omitempty"`
	UserSign  string       `json:"user_sign,omitempty" db:"user_sign,omitempty"`
	Payload   string       `json:"payload,omitempty" db:"payload,omitempty"`
	Message   string       `json:"message,omitempty" db:"message,omitempty"`
	CreatedAt dbutils.Time `json:"created_at,omitempty" db:"created_at,omitempty"`
}

type FTSIndex

type FTSIndex struct {
	Type        string         `json:"type,omitempty" yaml:"type,omitempty"`
	Slug        string         `json:"slug,omitempty" yaml:"slug,omitempty"`
	ColumnSpans []string       `json:"spans" yaml:"spans"`
	Options     map[string]any `json:"options" yaml:"options"`
}

type FilterCond

type FilterCond struct {
	Column string `json:"column,omitempty"`
	Cond   string `json:"cond,omitempty"`
	DValue any    `json:"value,omitempty"`
}

type FilterConds

type FilterConds []FilterCond

func (*FilterConds) Scan

func (j *FilterConds) Scan(value any) error

func (*FilterConds) Value

func (j *FilterConds) Value() (driver.Value, error)

type Index

type Index struct {
	Mtype string   `json:"mtype,omitempty" yaml:"mtype,omitempty"`
	Slug  string   `json:"slug,omitempty" yaml:"slug,omitempty"`
	Spans []string `json:"spans" yaml:"spans"`
}

type JsonArray

type JsonArray []string

func (*JsonArray) Scan

func (j *JsonArray) Scan(value any) error

func (*JsonArray) Value

func (j *JsonArray) Value() (driver.Value, error)

type JsonMap

type JsonMap map[string]any

func (JsonMap) Scan

func (j JsonMap) Scan(value any) error

func (JsonMap) Value

func (j JsonMap) Value() (driver.Value, error)

type JsonStrMap

type JsonStrMap map[string]string

func (JsonStrMap) Scan

func (j JsonStrMap) Scan(value any) error

func (JsonStrMap) Value

func (j JsonStrMap) Value() (driver.Value, error)

type ModifyMessages

type ModifyMessages struct {
	Operation string  `json:"ops,omitempty"`
	Ids       []int64 `json:"ids,omitempty"`
}

type Plug

type Plug struct {
	Id   string `json:"id,omitempty" db:"id,omitempty"`
	Name string `json:"name,omitempty" db:"name,omitempty"`
	Live bool   `json:"live,omitempty" db:"live,omitempty"`
	Dev  bool   `json:"dev,omitempty"  db:"dev,omitempty"`

	BprintId         string `json:"bprint_id,omitempty"  db:"bprint_id,omitempty"`
	BprintItemId     string `json:"bprint_item_id,omitempty"  db:"bprint_item_id,omitempty"`
	BprintInstanceId string `json:"bprint_instance_id,omitempty"  db:"bprint_instance_id,omitempty"`

	InvokePolicy string     `json:"invoke_policy,omitempty" db:"invoke_policy,omitempty"`
	ExtraMeta    JsonStrMap `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
	TenantId     string     `json:"tenant_id,omitempty" db:"tenant_id,omitempty"`
}

type PlugKV

type PlugKV struct {
	Key     string `json:"key,omitempty" db:"key"`
	Value   string `json:"value,omitempty" db:"value"`
	Version int64  `json:"version,omitempty" db:"Version"`

	PlugsID  string `json:"plug_id,omitempty" db:"plug_id"`
	TenantID string `json:"tenant_id,omitempty" db:"tenant_id"`

	// meta
	Tag1 string        `json:"tag1,omitempty" db:"tag1"`
	Tag2 string        `json:"tag2,omitempty" db:"tag2"`
	Tag3 string        `json:"tag3,omitempty" db:"tag3"`
	TTL  *dbutils.Time `json:"ttl,omitempty" db:"ttl"`
}

type Repo

type Repo struct {
	Id        int64      `json:"id,omitempty" db:"id,omitempty"`
	Name      string     `json:"name,omitempty" db:"name,omitempty"`
	Provider  string     `json:"provider,omitempty" db:"provider,omitempty"`
	URL       string     `json:"url,omitempty" db:"url,omitempty"`
	TenantId  string     `json:"tenant_id,omitempty" db:"tenant_id,omitempty"`
	ExtraMeta JsonStrMap `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
}

type Resource

type Resource struct {
	Id               string     `json:"id,omitempty" db:"id,omitempty"`
	Name             string     `json:"name,omitempty" db:"name,omitempty"`
	Type             string     `json:"type,omitempty" db:"type,omitempty"`
	SubType          string     `json:"sub_type,omitempty" db:"sub_type,omitempty"`
	Target           string     `json:"target,omitempty" db:"target,omitempty"`
	Payload          string     `json:"payload,omitempty" db:"payload,omitempty"`
	Policy           string     `json:"policy,omitempty" db:"policy,omitempty"`
	BprintId         string     `json:"bprint_id,omitempty"  db:"bprint_id,omitempty"`
	BprintItemId     string     `json:"bprint_item_id,omitempty"  db:"bprint_item_id,omitempty"`
	BprintInstanceId string     `json:"bprint_instance_id,omitempty"  db:"bprint_instance_id,omitempty"`
	ExtraMeta        JsonStrMap `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
	TenantId         string     `json:"tenant_id,omitempty" db:"tenant_id,omitempty"`
}

func (*Resource) SplitTarget

func (r *Resource) SplitTarget(expected int) ([]string, error)

type ResourcePair

type ResourcePair struct {
	AgentResource *AgentResource
	Resource      *Resource
}

ResourcePair is container with resource and AgentResource

type SavedToken

type SavedToken struct {
	Id        string        `json:"id,omitempty" db:"id,omitempty"`
	Type      string        `json:"type,omitempty" db:"type,omitempty"`
	UserId    string        `json:"user_id,omitempty" db:"user_id,omitempty"`
	UserGroup string        `json:"user_group,omitempty" db:"user_group,omitempty"`
	Target    string        `json:"target,omitempty" db:"target,omitempty"`
	Payload   string        `json:"payload,omitempty" db:"payload,omitempty"`
	TenantId  string        `json:"tenant_id,omitempty" db:"tenant_id,omitempty"`
	ExpiresOn *dbutils.Time `json:"expires_on,omitempty" db:"expires_on,omitempty"`
	ExtraMeta JsonStrMap    `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
}

type SelfLoad

type SelfLoad struct {
	TenantName string    `json:"tenant_name,omitempty"`
	TenantId   string    `json:"tenant_id,omitempty"`
	UserInfo   UserInfo  `json:"user_info,omitempty"`
	Scopes     []string  `json:"scopes,omitempty"`
	Apps       []UserApp `json:"apps,omitempty"`
}

type SystemEvent

type SystemEvent struct {
	Id        int64      `json:"id,omitempty" db:"id,omitempty"`
	Type      string     `json:"type,omitempty" db:"type,omitempty"`
	Data      string     `json:"data,omitempty" db:"data,omitempty"`
	ExtraMeta JsonStrMap `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
	TenantId  string     `json:"tenant_id,omitempty" db:"tenant_id,omitempty"`
}

type SystemKV

type SystemKV struct {
	Id       int64  `json:"id,omitempty" db:"id,omitempty"`
	Key      string `json:"key,omitempty" db:"key,omitempty"`
	Type     string `json:"type,omitempty" db:"type,omitempty"`
	Value    string `json:"value,omitempty" db:"value,omitempty"`
	TenantId string `json:"tenant_id,omitempty" db:"tenant_id,omitempty"`
}

type Table

type Table struct {
	Name         string     `json:"name,omitempty" db:"name"`
	Slug         string     `json:"slug,omitempty" db:"slug"`
	GroupID      string     `json:"group_id,omitempty" db:"group_id"`
	Description  string     `json:"description,omitempty" db:"description"`
	Icon         string     `json:"icon,omitempty" db:"icon"`
	MainColumn   string     `json:"main_column,omitempty" db:"main_column"`
	MainView     string     `json:"main_view,omitempty" db:"main_view"`
	ActivityType string     `json:"activity_type,omitempty" db:"activity_type"`
	SyncType     string     `json:"sync_type,omitempty" db:"sync_type"`
	TenantID     string     `json:"tenant_id,omitempty" db:"tenant_id"`
	ExtraMeta    JsonStrMap `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
}

type TableGroup

type TableGroup struct {
	Name          string `json:"name,omitempty" db:"name"`
	Slug          string `json:"slug,omitempty" db:"slug"`
	Description   string `json:"description,omitempty" db:"description"`
	SourceDb      string `json:"source_db,omitempty" db:"source_db"`
	TenantID      string `json:"tenant_id,omitempty" db:"tenant_id"`
	CabinetSource string `json:"cabinet_source,omitempty" db:"cabinet_source"`
	CabinetFolder string `json:"cabinet_folder,omitempty" db:"cabinet_folder"`
	Renderer      string `json:"renderer,omitempty" db:"renderer"`

	BprintId         string `json:"bprint_id,omitempty"  db:"bprint_id,omitempty"`
	BprintItemId     string `json:"bprint_item_id,omitempty"  db:"bprint_item_id,omitempty"`
	BprintInstanceId string `json:"bprint_instance_id,omitempty"  db:"bprint_instance_id,omitempty"`
	BprintStepHead   string `json:"bprint_step_head,omitempty"  db:"bprint_step_head,omitempty"`

	ExtraMeta JsonStrMap `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
	Active    bool       `json:"active,omitempty" db:"active"`
}

type TableGroupPartial

type TableGroupPartial struct {
	Name          string  `json:"name,omitempty" db:"name,omitempty"`
	Description   string  `json:"description,omitempty" db:"description,omitempty"`
	CabinetSource string  `json:"cabinet_source,omitempty" db:"cabinet_source,omitempty"`
	CabinetFolder string  `json:"cabinet_folder,omitempty" db:"cabinet_folder,omitempty"`
	Renderer      string  `json:"renderer,omitempty" db:"renderer,omitempty"`
	ExtraMeta     JsonMap `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
}

type TablePartial

type TablePartial struct {
	Name        string  `json:"name,omitempty" db:"name,omitempty"`
	Description string  `json:"description,omitempty" db:"description,omitempty"`
	Icon        string  `json:"icon,omitempty" db:"icon,omitempty"`
	MainColumn  string  `json:"main_column,omitempty" db:"main_column,omitempty"`
	ExtraMeta   JsonMap `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
}

type TargetApp

type TargetApp struct {
	Id          int64  `json:"id,omitempty" db:"id,omitempty"`
	Name        string `json:"name,omitempty" db:"name,omitempty"`
	Icon        string `json:"icon,omitempty" db:"icon,omitempty"`
	Policy      string `json:"policy,omitempty" db:"policy,omitempty"`
	TargetType  string `json:"target_type,omitempty" db:"target_type,omitempty"`
	Target      string `json:"target,omitempty" db:"target,omitempty"`
	ContextType string `json:"context_type,omitempty" db:"context_type,omitempty"`
	PlugId      string `json:"plug_id,omitempty" db:"plug_id,omitempty"`
	AgentId     string `json:"agent_id,omitempty" db:"agent_id,omitempty"`

	BprintId         string `json:"bprint_id,omitempty"  db:"bprint_id,omitempty"`
	BprintItemId     string `json:"bprint_item_id,omitempty"  db:"bprint_item_id,omitempty"`
	BprintInstanceId string `json:"bprint_instance_id,omitempty"  db:"bprint_instance_id,omitempty"`

	ExecDomain int64      `json:"exec_domain,omitempty" db:"exec_domain,omitempty"`
	ExecMeta   JsonStrMap `json:"exec_meta,omitempty" db:"exec_meta,omitempty"`
	ExtraMeta  JsonStrMap `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
	TenantId   string     `json:"tenant_id,omitempty" db:"tenant_id,omitempty"`
}

type TargetHook

type TargetHook struct {
	Id         int64  `json:"id,omitempty" db:"id,omitempty"`
	Name       string `json:"name,omitempty" db:"name,omitempty"`
	TargetType string `json:"target_type,omitempty" db:"target_type,omitempty"`
	Target     string `json:"target,omitempty" db:"target,omitempty"`
	EventType  string `json:"event_type,omitempty" db:"event_type,omitempty"`
	Policy     string `json:"policy,omitempty" db:"policy,omitempty"`
	PlugId     string `json:"plug_id,omitempty" db:"plug_id,omitempty"`
	AgentId    string `json:"agent_id,omitempty" db:"agent_id,omitempty"`
	Handler    string `json:"handler,omitempty" db:"handler,omitempty"`

	BprintId         string `json:"bprint_id,omitempty"  db:"bprint_id,omitempty"`
	BprintItemId     string `json:"bprint_item_id,omitempty"  db:"bprint_item_id,omitempty"`
	BprintInstanceId string `json:"bprint_instance_id,omitempty"  db:"bprint_instance_id,omitempty"`

	ExecMeta  JsonStrMap `json:"exec_meta,omitempty" db:"exec_meta,omitempty"`
	ExtraMeta JsonStrMap `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
	TenantId  string     `json:"tenant_id,omitempty" db:"tenant_id,omitempty"`
}

type Tenant

type Tenant struct {
	Name           string     `json:"name,omitempty" db:"name,omitempty"`
	Slug           string     `json:"slug,omitempty" db:"slug,omitempty"`
	OrgBio         string     `json:"org_bio,omitempty" db:"org_bio,omitempty"`
	DefaultDSource string     `json:"default_dyn,omitempty" db:"default_dyn,omitempty"`
	DefaultUgroup  string     `json:"default_ugroup,omitempty" db:"default_ugroup,omitempty"`
	DisableP2P     bool       `json:"disable_p2p,omitempty" db:"disable_p2p,omitempty"`
	MasterSecret   string     `json:"master_secret,omitempty" db:"master_secret,omitempty"`
	ExtraMeta      JsonStrMap `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
}

type TenantDomain

type TenantDomain struct {
	Id             int64      `json:"id,omitempty" db:"id,omitempty"`
	Name           string     `json:"name,omitempty" db:"name,omitempty"`
	About          string     `json:"about,omitempty" db:"about,omitempty"`
	DefaultUgroup  string     `json:"default_ugroup,omitempty" db:"default_ugroup,omitempty"`
	CORSPolicy     string     `json:"cors_policy,omitempty" db:"cors_policy,omitempty"`
	AdapterPolicy  string     `json:"adapter_policy,omitempty" db:"adapter_policy,omitempty"`
	AdapterType    string     `json:"adapter_type,omitempty" db:"adapter_type,omitempty"` // dynamic, plug_app, landing_page, static, alias, launcher
	AdapterOptions JsonStrMap `json:"adapter_opts,omitempty" db:"adapter_opts,omitempty"`
	TenantId       string     `json:"tenant_id,omitempty" db:"tenant_id,omitempty"`
	ExtraMeta      JsonStrMap `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
}

type User

type User struct {
	UserId    string       `json:"user_id,omitempty" db:"user_id"`
	FullName  string       `json:"full_name,omitempty" db:"full_name"`
	Email     string       `json:"email,omitempty" db:"email"`
	Bio       string       `json:"bio,omitempty" db:"bio"`
	GroupID   string       `json:"group_id,omitempty" db:"group_id"`
	Password  string       `json:"password,omitempty" db:"password"`
	TenantID  string       `json:"tenant_id,omitempty" db:"tenant_id"`
	PublicKey string       `json:"pub_key,omitempty" db:"pub_key"`
	CreatedAt dbutils.Time `json:"created_at,omitempty" db:"created_at"`
	Active    bool         `json:"active,omitempty" db:"active"`
}

type UserApp

type UserApp struct {
	Id       int64  `json:"id,omitempty"`
	Name     string `json:"name,omitempty"`
	PlugId   string `json:"plug_id,omitempty"`
	AgentId  string `json:"agent_id,omitempty"`
	Icon     string `json:"icon,omitempty"`
	TargetId int64  `json:"target_id,omitempty"`
}

type UserData

type UserData struct {
	UserId             string     `json:"user_id,omitempty" db:"user_id"`
	MFAEnabled         bool       `json:"mfa_enabled,omitempty" db:"mfa_enabled"`
	MFAType            string     `json:"mfa_type,omitempty" db:"mfa_type"`
	MFAData            string     `json:"mfa_data,omitempty" db:"mfa_data"`
	PendingPassChange  bool       `json:"pending_pass_change,omitempty"  db:"pending_pass_change"`
	PendingEmailVerify bool       `json:"pending_email_verify,omitempty" db:"pending_email_verify"`
	ExtraMeta          JsonStrMap `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
	TenantID           string     `json:"tenant_id,omitempty" db:"tenant_id"`
}

func (*UserData) Scan

func (ud *UserData) Scan(value any) error

func (*UserData) Value

func (ud *UserData) Value() (driver.Value, error)

type UserDevice

type UserDevice struct {
	Id          int64        `json:"id,omitempty" db:"id,omitempty"`
	Name        string       `json:"name,omitempty" db:"name,omitempty"`
	UserId      string       `json:"user_id,omitempty" db:"user_id,omitempty"`
	DeviceType  string       `json:"device_type,omitempty" db:"device_type,omitempty"`
	APNToken    string       `json:"apn_token,omitempty" db:"apn_token,omitempty"`
	Scopes      string       `json:"scopes,omitempty" db:"scopes,omitempty"`
	LastData    JsonStrMap   `json:"last_data,omitempty" db:"last_data,omitempty"`
	PairOptions JsonStrMap   `json:"pair_options,omitempty" db:"pair_options,omitempty"`
	ExtraMeta   JsonStrMap   `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
	ExpiresOn   dbutils.Time `json:"expires_on,omitempty" db:"expires_on"`
	TenantID    string       `json:"tenant_id,omitempty" db:"tenant_id,omitempty"`
}

func (*UserDevice) Derive

func (ud *UserDevice) Derive(ugroup string) *claim.User

type UserGroup

type UserGroup struct {
	Name        string     `json:"name,omitempty" db:"name"`
	Slug        string     `json:"slug,omitempty" db:"slug"`
	Scopes      string     `json:"scopes,omitempty" db:"scopes"`
	Features    string     `json:"features,omitempty" db:"features"`
	FeatureOpts JsonStrMap `json:"feature_opts" db:"feature_opts,omitempty"`
	ExtraMeta   JsonStrMap `json:"extra_meta" db:"extra_meta,omitempty"`
	ModVersion  int64      `json:"mod_version,omitempty" db:"mod_version"`
	TenantID    string     `json:"tenant_id,omitempty" db:"tenant_id"`
}

func (*UserGroup) HasFeature

func (ug *UserGroup) HasFeature(feature string) bool

type UserGroupAuth

type UserGroupAuth struct {
	Id                int64      `json:"id,omitempty" db:"id,omitempty"`
	Name              string     `json:"name,omitempty" db:"name,omitempty"`
	Type              string     `json:"type,omitempty" db:"type,omitempty"`
	Provider          string     `json:"provider,omitempty" db:"provider,omitempty"`
	ProviderOptions   JsonStrMap `json:"provider_opts,omitempty" db:"provider_opts,omitempty"`
	Scopes            string     `json:"scopes,omitempty" db:"scopes,omitempty"`
	NewUserIfNotExist bool       `json:"newuser_ifnot_exists,omitempty" db:"newuser_ifnot_exists,omitempty"`
	Policy            string     `json:"policy,omitempty"  db:"policy,omitempty"`
	UserGroup         string     `json:"user_group,omitempty" db:"user_group,omitempty"`
	TenantId          string     `json:"tenant_id,omitempty" db:"tenant_id,omitempty"`
	ExtraMeta         JsonStrMap `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
}

func (*UserGroupAuth) AuthURL

func (u *UserGroupAuth) AuthURL() string

func (*UserGroupAuth) ClientId

func (u *UserGroupAuth) ClientId() string

func (*UserGroupAuth) ClientSecret

func (u *UserGroupAuth) ClientSecret() string

func (*UserGroupAuth) TokenURL

func (u *UserGroupAuth) TokenURL() string

type UserGroupData

type UserGroupData struct {
	Id         int64      `json:"id,omitempty" db:"id,omitempty"`
	DataSource string     `json:"data_source,omitempty" db:"data_source,omitempty"`
	DataGroup  string     `json:"data_group,omitempty" db:"data_group,omitempty"`
	Policy     string     `json:"policy,omitempty" db:"policy,omitempty"`
	UserGroup  string     `json:"user_group,omitempty" db:"user_group,omitempty"`
	TenantId   string     `json:"tenant_id,omitempty" db:"tenant_id,omitempty"`
	ExtraMeta  JsonStrMap `json:"extra_meta,omitempty" db:"extra_meta,omitempty"`
}

type UserInfo

type UserInfo struct {
	UserId    string `json:"user_id,omitempty"`
	FullName  string `json:"full_name,omitempty"`
	Bio       string `json:"bio,omitempty" db:"bio"`
	PublicKey string `json:"pub_key,omitempty"`
	Email     string `json:"email,omitempty"`
	GroupName string `json:"group_name,omitempty"`
	GroupId   string `json:"group,omitempty"`
}

type UserMessage

type UserMessage struct {
	Id           int           `json:"id,omitempty" db:"id,omitempty"`
	Title        string        `json:"title,omitempty" db:"title,omitempty"`
	Read         bool          `json:"read,omitempty" db:"read,omitempty"`
	Type         string        `json:"type,omitempty" db:"type"`
	Contents     string        `json:"contents,omitempty" db:"contents"`
	UserId       string        `json:"user_id,omitempty" db:"user_id"`
	FromUser     string        `json:"from_user,omitempty" db:"from_user,omitempty,"`
	FromPlug     string        `json:"from_plug,omitempty" db:"from_plug,omitempty,"`
	FromAgent    string        `json:"from_agent,omitempty" db:"from_agent,omitempty,"`
	PlugCallback string        `json:"plug_callback,omitempty" db:"plug_callback,omitempty"`
	WarnLevel    int           `json:"warn_level,omitempty" db:"warn_level,omitempty"`
	Encrypted    bool          `json:"encrypted,omitempty" db:"encrypted,omitempty"`
	CreatedAt    *dbutils.Time `json:"created_at,omitempty" db:"created_at,omitempty"`
	TenantId     string        `json:"tenant_id,omitempty" db:"tenant_id"`
}

type UserMessageReq

type UserMessageReq struct {
	Cursor int64  `json:"cursor,omitempty"`
	Count  int64  `json:"count,omitempty"`
	UserId string `json:"user_id,omitempty"`
}

type UserUpdate

type UserUpdate struct {
	FullName  string   `json:"full_name,omitempty" db:"full_name,omitempty"`
	Email     string   `json:"email,omitempty" db:"email,omitempty"`
	GroupID   string   `json:"group_id,omitempty" db:"group_id,omitempty"`
	Password  string   `json:"password,omitempty" db:"password,omitempty"`
	PublicKey string   `json:"pub_key,omitempty" db:"pub_key,omitempty"`
	AuthType  string   `json:"auth_type,omitempty" db:"auth_type,omitempty"`
	Data      UserData `json:"data,omitempty" db:"data,omitempty"`
}

type View

type View struct {
	Name        string      `json:"name,omitempty"`
	Count       int64       `json:"count,omitempty"`
	FilterConds FilterConds `json:"filter_conds,omitempty"`
	Selects     []string    `json:"selects,omitempty"`
	MainColumn  string      `json:"main_column,omitempty"`
	SearchTerm  string      `json:"search_term,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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