types

package
v0.0.0-...-dfb39b5 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExternalProviderUsageIdentity = "identity"
	ExternalProviderUsageAPI      = "api"
)
View Source
const (
	AttachmentKindSettings       string = "settings"
	AttachmentKindAvatar         string = "avatar"
	AttachmentKindAvatarInitials string = "avatar-initials"
	AttachmentKindChatbot        string = "chatbot"
)
View Source
const (
	// RequestKindCorrect to correct module fields
	RequestKindCorrect RequestKind = "correct"
	// RequestKindDelete to delete module fields
	RequestKindDelete RequestKind = "delete"
	// RequestKindExport to export module fields
	RequestKindExport RequestKind = "export"

	// RequestStatusPending initially request will be in pending status
	RequestStatusPending RequestStatus = "pending"
	// RequestStatusCanceled owner of request has cancelled the request
	RequestStatusCanceled RequestStatus = "canceled"
	// RequestStatusApproved data officer has of request has cancelled the request
	RequestStatusApproved RequestStatus = "approved"
	// RequestStatusRejected data officer has denied the request
	RequestStatusRejected RequestStatus = "rejected"
)
View Source
const (
	AttachmentResourceType                = "corteza::system:attachment"
	ApplicationResourceType               = "corteza::system:application"
	ApigwRouteResourceType                = "corteza::system:apigw-route"
	ApigwFilterResourceType               = "corteza::system:apigw-filter"
	AuthClientResourceType                = "corteza::system:auth-client"
	AuthConfirmedClientResourceType       = "corteza::system:auth-confirmed-client"
	AuthSessionResourceType               = "corteza::system:auth-session"
	AuthOa2tokenResourceType              = "corteza::system:auth-oa2token"
	CredentialResourceType                = "corteza::system:credential"
	DataPrivacyRequestResourceType        = "corteza::system:data-privacy-request"
	DataPrivacyRequestCommentResourceType = "corteza::system:data-privacy-request-comment"
	QueueResourceType                     = "corteza::system:queue"
	QueueMessageResourceType              = "corteza::system:queue-message"
	ReminderResourceType                  = "corteza::system:reminder"
	NotificationResourceType              = "corteza::system:notification"
	ReportResourceType                    = "corteza::system:report"
	ResourceTranslationResourceType       = "corteza::system:resource-translation"
	RoleResourceType                      = "corteza::system:role"
	RoleMemberResourceType                = "corteza::system:role-member"
	UserGroupResourceType                 = "corteza::system:user-group"
	SettingValueResourceType              = "corteza::system:settings"
	TemplateResourceType                  = "corteza::system:template"
	UserResourceType                      = "corteza::system:user"
	DalConnectionResourceType             = "corteza::system:dal-connection"
	DalSensitivityLevelResourceType       = "corteza::system:dal-sensitivity-level"
	DalSchemaAlterationResourceType       = "corteza::system:dal-schema-alteration"
	ConnectionResourceType                = "corteza::system:connection"
	ConfiguredConnectionResourceType      = "corteza::system:configured-connection"
	LlmProviderResourceType               = "corteza::system:llm-provider"
	AgentResourceType                     = "corteza::system:agent"
	AiConversationResourceType            = "corteza::system:ai-conversation"
	KnowledgeBaseResourceType             = "corteza::system:knowledge-base"
	ChatbotResourceType                   = "corteza::system:chatbot"
	ChatbotSessionResourceType            = "corteza::system:chatbot-session"
	ChatbotSessionStepResourceType        = "corteza::system:chatbot-session-step"
	ChatbotSessionHandoffResourceType     = "corteza::system:chatbot-session-handoff"
	ComponentResourceType                 = "corteza::system"
)

Variables

View Source
var (
	// Used to identify the primary DAL connection instead of an extra flag
	DalPrimaryConnectionResourceType = "corteza::system:primary-dal-connection"
	DalPrimaryConnectionHandle       = "primary-database"
)

Functions

func AgentRbacResource

func AgentRbacResource(id uint64) string

AgentRbacResource returns string representation of RBAC resource for Agent

RBAC resource is in the corteza::system:agent/... format

This function is auto-generated

func AgentRbacResourceTpl

func AgentRbacResourceTpl() string

func AiConversationRbacResource

func AiConversationRbacResource(id uint64) string

AiConversationRbacResource returns string representation of RBAC resource for AiConversation

RBAC resource is in the corteza::system:ai-conversation/... format

This function is auto-generated

func AiConversationRbacResourceTpl

func AiConversationRbacResourceTpl() string

func ApigwRouteRbacResource

func ApigwRouteRbacResource(id uint64) string

ApigwRouteRbacResource returns string representation of RBAC resource for ApigwRoute

RBAC resource is in the corteza::system:apigw-route/... format

This function is auto-generated

func ApigwRouteRbacResourceTpl

func ApigwRouteRbacResourceTpl() string

func ApplicationRbacResource

func ApplicationRbacResource(id uint64) string

ApplicationRbacResource returns string representation of RBAC resource for Application

RBAC resource is in the corteza::system:application/... format

This function is auto-generated

func ApplicationRbacResourceTpl

func ApplicationRbacResourceTpl() string

func AuthClientRbacResource

func AuthClientRbacResource(id uint64) string

AuthClientRbacResource returns string representation of RBAC resource for AuthClient

RBAC resource is in the corteza::system:auth-client/... format

This function is auto-generated

func AuthClientRbacResourceTpl

func AuthClientRbacResourceTpl() string

func ChatbotRbacResource

func ChatbotRbacResource(id uint64) string

ChatbotRbacResource returns string representation of RBAC resource for Chatbot

RBAC resource is in the corteza::system:chatbot/... format

This function is auto-generated

func ChatbotRbacResourceTpl

func ChatbotRbacResourceTpl() string

func ChatbotSessionHandoffRbacResource

func ChatbotSessionHandoffRbacResource(id uint64) string

ChatbotSessionHandoffRbacResource returns string representation of RBAC resource for ChatbotSessionHandoff

RBAC resource is in the corteza::system:chatbot-session-handoff/... format

This function is auto-generated

func ChatbotSessionHandoffRbacResourceTpl

func ChatbotSessionHandoffRbacResourceTpl() string

func ChatbotSessionRbacResource

func ChatbotSessionRbacResource(id uint64) string

ChatbotSessionRbacResource returns string representation of RBAC resource for ChatbotSession

RBAC resource is in the corteza::system:chatbot-session/... format

This function is auto-generated

func ChatbotSessionRbacResourceTpl

func ChatbotSessionRbacResourceTpl() string

func ChatbotSessionStepRbacResource

func ChatbotSessionStepRbacResource(id uint64) string

ChatbotSessionStepRbacResource returns string representation of RBAC resource for ChatbotSessionStep

RBAC resource is in the corteza::system:chatbot-session-step/... format

This function is auto-generated

func ChatbotSessionStepRbacResourceTpl

func ChatbotSessionStepRbacResourceTpl() string

func ComponentRbacResource

func ComponentRbacResource() string

ComponentRbacResource returns string representation of RBAC resource for Component

RBAC resource is in the corteza::system/ format

This function is auto-generated

func ComponentRbacResourceTpl

func ComponentRbacResourceTpl() string

func ConfiguredConnectionRbacResource

func ConfiguredConnectionRbacResource(id uint64) string

ConfiguredConnectionRbacResource returns string representation of RBAC resource for ConfiguredConnection

RBAC resource is in the corteza::system:configured-connection/... format

This function is auto-generated

func ConfiguredConnectionRbacResourceTpl

func ConfiguredConnectionRbacResourceTpl() string

func ConnectionRbacResource

func ConnectionRbacResource(id uint64) string

ConnectionRbacResource returns string representation of RBAC resource for Connection

RBAC resource is in the corteza::system:connection/... format

This function is auto-generated

func ConnectionRbacResourceTpl

func ConnectionRbacResourceTpl() string

func DalConnectionRbacResource

func DalConnectionRbacResource(id uint64) string

DalConnectionRbacResource returns string representation of RBAC resource for DalConnection

RBAC resource is in the corteza::system:dal-connection/... format

This function is auto-generated

func DalConnectionRbacResourceTpl

func DalConnectionRbacResourceTpl() string

func DataPrivacyRequestRbacResource

func DataPrivacyRequestRbacResource(id uint64) string

DataPrivacyRequestRbacResource returns string representation of RBAC resource for DataPrivacyRequest

RBAC resource is in the corteza::system:data-privacy-request/... format

This function is auto-generated

func DataPrivacyRequestRbacResourceTpl

func DataPrivacyRequestRbacResourceTpl() string

func DecodeKV

func DecodeKV(kv SettingsKV, dst interface{}, pp ...string) (err error)

DecodeKV converts key-value (SettingsKV) into structs using tags & field names

Supports decoding into all scalar types, can handle nested structures and simple maps (1 dim, string as key)

Example: key-value pairs:

string1: "string"
number:  42
struct{
  String1 string `kv:"string1`
  Number  int
}

func KnowledgeBaseRbacResource

func KnowledgeBaseRbacResource(id uint64) string

KnowledgeBaseRbacResource returns string representation of RBAC resource for KnowledgeBase

RBAC resource is in the corteza::system:knowledge-base/... format

This function is auto-generated

func KnowledgeBaseRbacResourceTpl

func KnowledgeBaseRbacResourceTpl() string

func LlmProviderRbacResource

func LlmProviderRbacResource(id uint64) string

LlmProviderRbacResource returns string representation of RBAC resource for LlmProvider

RBAC resource is in the corteza::system:llm-provider/... format

This function is auto-generated

func LlmProviderRbacResourceTpl

func LlmProviderRbacResourceTpl() string

func QueueRbacResource

func QueueRbacResource(id uint64) string

QueueRbacResource returns string representation of RBAC resource for Queue

RBAC resource is in the corteza::system:queue/... format

This function is auto-generated

func QueueRbacResourceTpl

func QueueRbacResourceTpl() string

func ReportRbacResource

func ReportRbacResource(id uint64) string

ReportRbacResource returns string representation of RBAC resource for Report

RBAC resource is in the corteza::system:report/... format

This function is auto-generated

func ReportRbacResourceTpl

func ReportRbacResourceTpl() string

func RoleRbacResource

func RoleRbacResource(id uint64) string

RoleRbacResource returns string representation of RBAC resource for Role

RBAC resource is in the corteza::system:role/... format

This function is auto-generated

func RoleRbacResourceTpl

func RoleRbacResourceTpl() string

func TemplateRbacResource

func TemplateRbacResource(id uint64) string

TemplateRbacResource returns string representation of RBAC resource for Template

RBAC resource is in the corteza::system:template/... format

This function is auto-generated

func TemplateRbacResourceTpl

func TemplateRbacResourceTpl() string

func UserGroupRbacResource

func UserGroupRbacResource(id uint64) string

UserGroupRbacResource returns string representation of RBAC resource for UserGroup

RBAC resource is in the corteza::system:user-group/... format

This function is auto-generated

func UserGroupRbacResourceTpl

func UserGroupRbacResourceTpl() string

func UserRbacResource

func UserRbacResource(id uint64) string

UserRbacResource returns string representation of RBAC resource for User

RBAC resource is in the corteza::system:user/... format

This function is auto-generated

func UserRbacResourceTpl

func UserRbacResourceTpl() string

Types

type Agent

type Agent struct {
	ID       uint64 `json:"agentID,string"`
	Handle   string `json:"handle"`
	Status   string `json:"status"`
	Revision int    `json:"revision"`

	Labels map[string]labelTypes.LabelValue `json:"labels,omitempty"`

	Meta       AgentMeta       `json:"meta"`
	Behavior   AgentBehavior   `json:"behavior"`
	Execution  AgentExecution  `json:"execution"`
	Access     AgentAccess     `json:"access"`
	Invocation AgentInvocation `json:"invocation"`

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	CreatedBy uint64     `json:"createdBy,string"`
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	UpdatedBy uint64     `json:"updatedBy,string,omitempty"`
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
	DeletedBy uint64     `json:"deletedBy,string,omitempty"`
}

func (Agent) GetID

func (r Agent) GetID() uint64

func (Agent) GetLabels

func (m Agent) GetLabels() map[string]labelTypes.LabelValue

GetLabels adds new label to label map

func (*Agent) GetValue

func (r *Agent) GetValue(name string, pos uint) (any, error)

func (Agent) LabelResourceID

func (m Agent) LabelResourceID() uint64

GetLabels adds new label to label map

func (Agent) LabelResourceKind

func (Agent) LabelResourceKind() string

GetLabels adds new label to label map

func (Agent) RbacResource

func (r Agent) RbacResource() string

RbacResource returns string representation of RBAC resource for Agent by calling AgentRbacResource fn

RBAC resource is in the corteza::system:agent/... format

This function is auto-generated

func (*Agent) SetLabel

func (m *Agent) SetLabel(key string, value labelTypes.LabelValue)

SetLabel adds new label to label map

func (*Agent) SetValue

func (r *Agent) SetValue(name string, pos uint, value any) (err error)

type AgentAccess

type AgentAccess struct {
	Context   AgentAccessContext    `json:"context"`
	Tools     []AgentAccessTool     `json:"tools,omitempty"`
	TAQs      []AgentAccessTAQ      `json:"taqs,omitempty"`
	Workflows []AgentAccessWorkflow `json:"workflows,omitempty"`
}

func ParseAgentAccess

func ParseAgentAccess(ss []string) (p AgentAccess, err error)

func (*AgentAccess) Scan

func (m *AgentAccess) Scan(src any) error

func (AgentAccess) Value

func (m AgentAccess) Value() (driver.Value, error)

type AgentAccessAllow

type AgentAccessAllow struct {
	NamespaceID uint64            `json:"namespaceID,string"`
	ModuleIDs   AgentAccessIDList `json:"moduleIDs"`
}

type AgentAccessContext

type AgentAccessContext struct {
	Namespace string         `json:"namespace,omitempty"`
	Module    string         `json:"module,omitempty"`
	Defaults  map[string]any `json:"defaults,omitempty"`
}

type AgentAccessIDList

type AgentAccessIDList []uint64

AgentAccessIDList is a []uint64 that serializes each element as a JSON string.

func (AgentAccessIDList) MarshalJSON

func (ll AgentAccessIDList) MarshalJSON() ([]byte, error)

func (*AgentAccessIDList) UnmarshalJSON

func (ll *AgentAccessIDList) UnmarshalJSON(data []byte) error

type AgentAccessTAQ

type AgentAccessTAQ struct {
	ID          uint64            `json:"id,string"`
	Description string            `json:"description,omitempty"`
	Params      map[string]string `json:"params,omitempty"`
}

type AgentAccessTool

type AgentAccessTool struct {
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Allow       []AgentAccessAllow     `json:"allow"`
	Context     AgentAccessToolContext `json:"context,omitempty"`
}

type AgentAccessToolContext

type AgentAccessToolContext struct {
	Defaults  map[string]any `json:"defaults,omitempty"`
	Overrides map[string]any `json:"overrides,omitempty"`
}

type AgentAccessWorkflow

type AgentAccessWorkflow struct {
	ID          uint64 `json:"id,string"`
	Description string `json:"description,omitempty"`
}

type AgentBehavior

type AgentBehavior struct {
	SystemPrompt        string              `json:"systemPrompt,omitempty"`
	Guardrails          []string            `json:"guardrails,omitempty"`
	InjectSystemContext bool                `json:"injectSystemContext"`
	KnowledgeBases      KnowledgeBaseIDList `json:"knowledgeBases,omitempty"`
	TreatyCLEnabled     *bool               `json:"treatyCLEnabled"`          // nil = enabled by default
	TreatyCLTemperature int                 `json:"tclTemperature,omitempty"` // 1–10, controls citation verbosity
	TreatyCLArticles    []string            `json:"tclArticles,omitempty"`    // selected article IDs
}

func ParseAgentBehavior

func ParseAgentBehavior(ss []string) (p AgentBehavior, err error)

func (*AgentBehavior) Scan

func (m *AgentBehavior) Scan(src any) error

func (AgentBehavior) Value

func (m AgentBehavior) Value() (driver.Value, error)

type AgentExecution

type AgentExecution struct {
	Model  AgentExecutionModel  `json:"model"`
	Limits AgentExecutionLimits `json:"limits"`
}

func ParseAgentExecution

func ParseAgentExecution(ss []string) (p AgentExecution, err error)

func (*AgentExecution) Scan

func (m *AgentExecution) Scan(src any) error

func (AgentExecution) Value

func (m AgentExecution) Value() (driver.Value, error)

type AgentExecutionLimits

type AgentExecutionLimits struct {
	MaxIterations  int     `json:"maxIterations,omitempty"`
	Timeout        string  `json:"timeout"`
	SoftLimitRatio float64 `json:"softLimitRatio,omitempty"`
	ContextWindow  int     `json:"contextWindow"`
	OutputTokens   int     `json:"outputTokens"`
}

type AgentExecutionModel

type AgentExecutionModel struct {
	LLMProviderID uint64   `json:"llmProviderID,string,omitempty"`
	Model         string   `json:"model,omitempty"`
	Temperature   *float64 `json:"temperature,omitempty"`
}

type AgentFilter

type AgentFilter struct {
	AgentID []string `json:"agentID"`
	Handle  string   `json:"handle"`
	Status  string   `json:"status"`
	Query   string   `json:"query"`

	Deleted filter.State `json:"deleted"`

	LabeledIDs []uint64                         `json:"-"`
	Labels     map[string]labelTypes.LabelValue `json:"labels,omitempty"`

	// Check fn is called by store backend for each resource found function can
	// modify the resource and return false if store should not return it
	//
	// Store then loads additional resources to satisfy the paging parameters
	Check func(*Agent) (bool, error) `json:"-"`

	filter.Sorting
	filter.Paging
}

type AgentInvocation

type AgentInvocation struct {
	User   AgentInvocationUser   `json:"user"`
	System AgentInvocationSystem `json:"system"`
}

func ParseAgentInvocation

func ParseAgentInvocation(ss []string) (p AgentInvocation, err error)

func (*AgentInvocation) Scan

func (m *AgentInvocation) Scan(src any) error

func (AgentInvocation) Value

func (m AgentInvocation) Value() (driver.Value, error)

type AgentInvocationSystem

type AgentInvocationSystem struct {
	Enabled        bool            `json:"enabled"`
	ServiceAccount uint64          `json:"serviceAccount,string,omitempty"`
	InputSchema    json.RawMessage `json:"inputSchema,omitempty"`
	OutputFormat   string          `json:"outputFormat,omitempty"`
}

type AgentInvocationUser

type AgentInvocationUser struct {
	Enabled bool `json:"enabled"`
}

type AgentMeta

type AgentMeta struct {
	Short        string   `json:"short"`
	Description  string   `json:"description,omitempty"`
	SidebarRoles []string `json:"sidebarRoles,omitempty"`
}

func ParseAgentMeta

func ParseAgentMeta(ss []string) (p AgentMeta, err error)

func (*AgentMeta) Scan

func (m *AgentMeta) Scan(src any) error

func (AgentMeta) Value

func (m AgentMeta) Value() (driver.Value, error)

type AgentSet

type AgentSet []*Agent

AgentSet slice of Agent

This type is auto-generated.

func (AgentSet) Filter

func (set AgentSet) Filter(f func(*Agent) (bool, error)) (out AgentSet, err error)

Filter iterates through every slice item, calls f(Agent) (bool, err) and return filtered slice

This function is auto-generated.

func (AgentSet) FindByID

func (set AgentSet) FindByID(ID uint64) *Agent

FindByID finds items from slice by its ID property

This function is auto-generated.

func (AgentSet) IDs

func (set AgentSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (AgentSet) Walk

func (set AgentSet) Walk(w func(*Agent) error) (err error)

Walk iterates through every slice item and calls w(Agent) err

This function is auto-generated.

type AiConversation

type AiConversation struct {
	ID         uint64                 `json:"aiConversationID,string"`
	AgentID    uint64                 `json:"agentID,string"`
	Messages   AiConversationMessages `json:"messages"`
	TokenCount int                    `json:"tokenCount"`

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	CreatedBy uint64     `json:"createdBy,string"`
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	UpdatedBy uint64     `json:"updatedBy,string,omitempty"`
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
	DeletedBy uint64     `json:"deletedBy,string,omitempty"`
}

func (AiConversation) GetID

func (r AiConversation) GetID() uint64

func (*AiConversation) GetValue

func (r *AiConversation) GetValue(name string, pos uint) (any, error)

func (AiConversation) RbacResource

func (r AiConversation) RbacResource() string

RbacResource returns string representation of RBAC resource for AiConversation by calling AiConversationRbacResource fn

RBAC resource is in the corteza::system:ai-conversation/... format

This function is auto-generated

func (*AiConversation) SetValue

func (r *AiConversation) SetValue(name string, pos uint, value any) (err error)

type AiConversationFilter

type AiConversationFilter struct {
	AiConversationID []uint64     `json:"aiConversationID"`
	AgentID          uint64       `json:"agentID,string"`
	Deleted          filter.State `json:"deleted"`

	// Check fn is called by store backend for each resource found function can
	// modify the resource and return false if store should not return it
	//
	// Store then loads additional resources to satisfy the paging parameters
	Check func(*AiConversation) (bool, error) `json:"-"`

	filter.Sorting
	filter.Paging
}

type AiConversationMessage

type AiConversationMessage struct {
	Role        string                     `json:"role"`
	Content     string                     `json:"content"`
	Operator    string                     `json:"operator,omitempty"`
	ToolCalls   []AiConversationToolCall   `json:"toolCalls,omitempty"`
	ToolResults []AiConversationToolResult `json:"toolResults,omitempty"`
}

type AiConversationMessages

type AiConversationMessages []AiConversationMessage

func ParseAiConversationMessages

func ParseAiConversationMessages(ss []string) (p AiConversationMessages, err error)

func (*AiConversationMessages) Scan

func (m *AiConversationMessages) Scan(src any) error

func (AiConversationMessages) Value

type AiConversationSet

type AiConversationSet []*AiConversation

AiConversationSet slice of AiConversation

This type is auto-generated.

func (AiConversationSet) Filter

func (set AiConversationSet) Filter(f func(*AiConversation) (bool, error)) (out AiConversationSet, err error)

Filter iterates through every slice item, calls f(AiConversation) (bool, err) and return filtered slice

This function is auto-generated.

func (AiConversationSet) FindByID

func (set AiConversationSet) FindByID(ID uint64) *AiConversation

FindByID finds items from slice by its ID property

This function is auto-generated.

func (AiConversationSet) IDs

func (set AiConversationSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (AiConversationSet) Walk

func (set AiConversationSet) Walk(w func(*AiConversation) error) (err error)

Walk iterates through every slice item and calls w(AiConversation) err

This function is auto-generated.

type AiConversationToolCall

type AiConversationToolCall struct {
	CallID string `json:"callID"`
	Name   string `json:"name"`
	Data   string `json:"data"`
}

type AiConversationToolResult

type AiConversationToolResult struct {
	CallID string `json:"callID"`
	Data   string `json:"data"`
	Error  string `json:"error,omitempty"`
}

type ApigwFilter

type ApigwFilter struct {
	ID      uint64            `json:"filterID,string"`
	Route   uint64            `json:"routeID,string"`
	Weight  uint64            `json:"weight,string"`
	Ref     string            `json:"ref,omitempty"`
	Kind    string            `json:"kind,omitempty"`
	Enabled bool              `json:"enabled,omitempty"`
	Params  ApigwFilterParams `json:"params"`

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	CreatedBy uint64     `json:"createdBy,string" `
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	UpdatedBy uint64     `json:"updatedBy,string,omitempty" `
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
	DeletedBy uint64     `json:"deletedBy,string,omitempty" `
}

func (ApigwFilter) GetID

func (r ApigwFilter) GetID() uint64

func (*ApigwFilter) GetValue

func (r *ApigwFilter) GetValue(name string, pos uint) (any, error)

func (*ApigwFilter) SetValue

func (r *ApigwFilter) SetValue(name string, pos uint, value any) (err error)

type ApigwFilterFilter

type ApigwFilterFilter struct {
	ApigwFilterID []string `json:"apigwFilterID"`
	RouteID       uint64   `json:"routeID,string"`

	Deleted  filter.State `json:"deleted"`
	Disabled filter.State `json:"disabled"`

	Kind string `json:"kind"`
	Ref  string `json:"ref"`

	// Check fn is called by store backend for each resource found function can
	// modify the resource and return false if store should not return it
	//
	// Store then loads additional resources to satisfy the paging parameters
	Check func(*ApigwFilter) (bool, error) `json:"-"`

	filter.Sorting
	filter.Paging
}

type ApigwFilterParams

type ApigwFilterParams map[string]interface{}

func ParseApigwfFilterParams

func ParseApigwfFilterParams(ss []string) (p ApigwFilterParams, err error)

func (*ApigwFilterParams) Scan

func (vv *ApigwFilterParams) Scan(src any) error

func (ApigwFilterParams) Value

func (vv ApigwFilterParams) Value() (driver.Value, error)

type ApigwFilterSet

type ApigwFilterSet []*ApigwFilter

ApigwFilterSet slice of ApigwFilter

This type is auto-generated.

func (ApigwFilterSet) Filter

func (set ApigwFilterSet) Filter(f func(*ApigwFilter) (bool, error)) (out ApigwFilterSet, err error)

Filter iterates through every slice item, calls f(ApigwFilter) (bool, err) and return filtered slice

This function is auto-generated.

func (ApigwFilterSet) FindByID

func (set ApigwFilterSet) FindByID(ID uint64) *ApigwFilter

FindByID finds items from slice by its ID property

This function is auto-generated.

func (ApigwFilterSet) IDs

func (set ApigwFilterSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (ApigwFilterSet) Walk

func (set ApigwFilterSet) Walk(w func(*ApigwFilter) error) (err error)

Walk iterates through every slice item and calls w(ApigwFilter) err

This function is auto-generated.

type ApigwProfilerAggregation

type ApigwProfilerAggregation struct {
	Path  string  `json:"path"`
	Count uint64  `json:"count"`
	Smin  int64   `json:"size_min"`
	Smax  int64   `json:"size_max"`
	Savg  float64 `json:"size_avg"`
	Tmin  float64 `json:"time_min"`
	Tmax  float64 `json:"time_max"`
	Tavg  float64 `json:"time_avg"`
}

type ApigwProfilerAggregationSet

type ApigwProfilerAggregationSet []*ApigwProfilerAggregation

ApigwProfilerAggregationSet slice of ApigwProfilerAggregation

This type is auto-generated.

func (ApigwProfilerAggregationSet) Filter

Filter iterates through every slice item, calls f(ApigwProfilerAggregation) (bool, err) and return filtered slice

This function is auto-generated.

func (ApigwProfilerAggregationSet) Walk

Walk iterates through every slice item and calls w(ApigwProfilerAggregation) err

This function is auto-generated.

type ApigwProfilerFilter

type ApigwProfilerFilter struct {
	Hit    string `json:"hit,omitempty"`
	Path   string `json:"path,omitempty"`
	Before string `json:"before,omitempty"`
	Next   string `json:"next,omitempty"`

	filter.Sorting
	filter.Paging
}

type ApigwProfilerHit

type ApigwProfilerHit struct {
	ID string `json:"ID"`

	Body    []byte    `json:"body"`
	Request h.Request `json:"request"`
	Route   uint64    `json:"route,string"`
	Status  int       `json:"http_status_code,string"`

	Ts *time.Time     `json:"time_start"`
	Tf *time.Time     `json:"time_finish"`
	D  *time.Duration `json:"-"`
	Dr float64        `json:"time_duration"`
}

type ApigwProfilerHitSet

type ApigwProfilerHitSet []*ApigwProfilerHit

ApigwProfilerHitSet slice of ApigwProfilerHit

This type is auto-generated.

func (ApigwProfilerHitSet) Filter

func (set ApigwProfilerHitSet) Filter(f func(*ApigwProfilerHit) (bool, error)) (out ApigwProfilerHitSet, err error)

Filter iterates through every slice item, calls f(ApigwProfilerHit) (bool, err) and return filtered slice

This function is auto-generated.

func (ApigwProfilerHitSet) Walk

func (set ApigwProfilerHitSet) Walk(w func(*ApigwProfilerHit) error) (err error)

Walk iterates through every slice item and calls w(ApigwProfilerHit) err

This function is auto-generated.

type ApigwRoute

type ApigwRoute struct {
	ID       uint64         `json:"routeID,string"`
	Endpoint string         `json:"endpoint"`
	Method   string         `json:"method"`
	Enabled  bool           `json:"enabled"`
	Group    uint64         `json:"group,string"`
	Meta     ApigwRouteMeta `json:"meta"`

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	CreatedBy uint64     `json:"createdBy,string" `
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	UpdatedBy uint64     `json:"updatedBy,string,omitempty" `
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
	DeletedBy uint64     `json:"deletedBy,string,omitempty" `
}

func (ApigwRoute) GetID

func (r ApigwRoute) GetID() uint64

func (*ApigwRoute) GetValue

func (r *ApigwRoute) GetValue(name string, pos uint) (any, error)

func (ApigwRoute) RbacResource

func (r ApigwRoute) RbacResource() string

RbacResource returns string representation of RBAC resource for ApigwRoute by calling ApigwRouteRbacResource fn

RBAC resource is in the corteza::system:apigw-route/... format

This function is auto-generated

func (*ApigwRoute) SetValue

func (r *ApigwRoute) SetValue(name string, pos uint, value any) (err error)

type ApigwRouteFilter

type ApigwRouteFilter struct {
	ApigwRouteID []string `json:"apigwRouteID"`
	Route        string   `json:"route"`
	Endpoint     string   `json:"endpoint"`
	Method       string   `json:"method"`

	Deleted  filter.State `json:"deleted"`
	Disabled filter.State `json:"disabled"`

	// Check fn is called by store backend for each resource found function can
	// modify the resource and return false if store should not return it
	//
	// Store then loads additional resources to satisfy the paging parameters
	Check func(*ApigwRoute) (bool, error) `json:"-"`

	filter.Sorting
	filter.Paging
}

type ApigwRouteMeta

type ApigwRouteMeta struct {
	Debug  bool                             `json:"debug"`
	Async  bool                             `json:"async"`
	Desc   string                           `json:"description"`
	Labels map[string]labelTypes.LabelValue `json:"labels,omitempty"`
}

func ParseApigwRouteMeta

func ParseApigwRouteMeta(ss []string) (p ApigwRouteMeta, err error)

func (*ApigwRouteMeta) Scan

func (cc *ApigwRouteMeta) Scan(src any) error

func (ApigwRouteMeta) Value

func (cc ApigwRouteMeta) Value() (driver.Value, error)

type ApigwRouteSet

type ApigwRouteSet []*ApigwRoute

ApigwRouteSet slice of ApigwRoute

This type is auto-generated.

func (ApigwRouteSet) Filter

func (set ApigwRouteSet) Filter(f func(*ApigwRoute) (bool, error)) (out ApigwRouteSet, err error)

Filter iterates through every slice item, calls f(ApigwRoute) (bool, err) and return filtered slice

This function is auto-generated.

func (ApigwRouteSet) FindByID

func (set ApigwRouteSet) FindByID(ID uint64) *ApigwRoute

FindByID finds items from slice by its ID property

This function is auto-generated.

func (ApigwRouteSet) IDs

func (set ApigwRouteSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (ApigwRouteSet) Walk

func (set ApigwRouteSet) Walk(w func(*ApigwRoute) error) (err error)

Walk iterates through every slice item and calls w(ApigwRoute) err

This function is auto-generated.

type ApigwSettings

type ApigwSettings struct {
	Enabled bool `kv:"enabled" json:"enabled"`

	Profiler struct {
		Enabled bool `kv:"enabled" json:"enabled"`
		Global  bool `kv:"global" json:"global"`
	} `kv:"profiler" json:"profiler"`

	Proxy struct {
		FollowRedirects bool          `kv:"follow-redirects" json:"follow-redirects"`
		OutboundTimeout time.Duration `kv:"outbound-timeout" json:"outbound-timeout"`
	} `kv:"proxy" json:"proxy"`
}

type AppSettings

type AppSettings struct {
	Privacy struct {
		Mask struct {
			// Enable masking of user's email (value replaced with ######)
			Email bool

			// Enable masking of user's name (value replaced with ######)
			Name bool
		}
	} `json:"-"`

	General struct {
		Mail struct {
			Logo   string
			Header string `kv:"header.en"`
			Footer string `kv:"footer.en"`
		}
	} `json:"-"`

	SMTP struct {
		Servers []SmtpServers `json:"-" kv:"servers,final"`
	} `json:"-" kv:"smtp"`

	Auth struct {
		Internal struct {
			// Is internal authentication (username + password) enabled
			Enabled bool `json:"-"`

			Signup struct {
				// Can users register
				Enabled bool

				// Users must confirm their emails when signing-up
				EmailConfirmationRequired bool `kv:"email-confirmation-required"`
			} `json:"-"`

			// Can users reset their passwords
			PasswordReset struct{ Enabled bool } `json:"-" kv:"password-reset"`

			// When enabled, users added via CLI will receive an email with a link to reset their password.
			SendUserInviteEmail struct {
				Enabled bool
				Expires uint
			} `kv:"send-user-invite-email" json:"sendUserInviteEmail"`

			// PasswordCreate setting for create password for user via generated link with token
			// If user has no password then link redirects to create password page
			// Otherwise it redirects to profile page of that user
			// link can be generated through useradd cli command with `make-password-link` flag
			PasswordCreate struct {
				Enabled bool
				Expires uint
			} `json:"-" kv:"password-create"`

			// Splits credentials check into 2 parts
			// If user has password credentials it offers him to enter the password
			// Otherwise we offer the user to choose among the enabled external providers
			// If only one ext. provider is enabled, user is automatically redirected there
			SplitCredentialsCheck bool `json:"-" kv:"split-credentials-check"`

			PasswordConstraints PasswordConstraints `kv:"password-constraints" json:"passwordConstraints"`

			ProfileAvatar struct{ Enabled bool } `kv:"profile-avatar" json:"profile-avatar"`
		} `json:"internal"`

		External struct {
			// Is external authentication
			Enabled bool `json:"enabled"`

			// Saml
			Saml struct {
				Enabled bool

				// IdP name used on the login form
				Name string `kv:"name"`

				// SAML certificate
				Cert string `kv:"cert"`

				// SAML certificate private key
				Key string `kv:"key"`

				// Sign AuthNRequest and assertion
				SignRequests bool `kv:"sign-requests"`

				// Signature method for signing
				SignMethod string `kv:"sign-method"`

				// Post or redirect binding
				Binding string `kv:"binding"`

				// Identity provider settings
				IDP struct {
					URL string `kv:"url"`

					// identifier payload from idp
					IdentName       string `kv:"ident-name"`
					IdentHandle     string `kv:"ident-handle"`
					IdentIdentifier string `kv:"ident-identifier"`
				} `kv:"idp"`

				Security ExternalAuthProviderSecurity `json:"-" kv:"security,final"`
			} `json:"-"`

			// all external providers we know
			Providers ExternalAuthProviderSet `json:"providers"`
		} `json:"external"`

		AutoLogOut struct {
			Enabled bool `kv:"enabled" json:"enabled"`
			Timeout int  `kv:"timeout" json:"timeout"`
		} `json:"autoLogout" kv:"auto-logout"`

		MultiFactor struct {
			EmailOTP struct {
				// Can users use email for MFA
				Enabled bool

				// Is MFA with email enforced?
				Enforced bool

				Expires uint
			} `kv:"email-otp"`

			TOTP struct {
				// Can users use TOTP for MFA
				Enabled bool

				// Is MFA with TOTP enforced?
				Enforced bool

				// TOTP issuer, defaults to "Human"
				Issuer string
			} `kv:"totp"`
		} `json:"-" kv:"multi-factor"`

		Mail struct {
			FromAddress string `kv:"from-address"`
			FromName    string `kv:"from-name"`
		} `json:"-"`

		// Auth Background Image settings
		UI struct {
			BackgroundImageSrc string `kv:"background-image-src" json:"backgroundImageSrc"`
			Styles             string `kv:"styles" json:"styles"`
		} `kv:"ui" json:"ui"`
	} `json:"auth"`

	Compose struct {
		// Compose UI settings
		UI struct {
			// Sidebar specific settings
			Sidebar struct {
				// Hide namespace list
				HideNamespaceList bool `json:"hideNamespaceList"`

				// Hide namespace link at the end of the list
				HideNamespaceListLink bool `json:"hideNamespaceListLink"`
			} `kv:"sidebar,final" json:"sidebar"`

			// Record toolbar specific settings
			RecordToolbar struct {
				HideNew    bool `json:"hideNew"`
				HideEdit   bool `json:"hideEdit"`
				HideSubmit bool `json:"hideSubmit"`
				HideDelete bool `json:"hideDelete"`
				HideClone  bool `json:"hideClone"`
				HideBack   bool `json:"hideBack"`
			} `kv:"record-toolbar,final" json:"record-toolbar"`
		} `kv:"ui" json:"ui"`

		// Record related settings
		Record struct {
			// @todo implementation
			Attachments struct {
				// What is max size (in MB, so: MaxSize x 2^20)
				MaxSize uint `kv:"max-size"`

				// List of mime-types we support,
				Mimetypes []string
			}
		}

		// Page related settings
		Page struct {
			// @todo implementation
			Attachments struct {
				// What is max size (in MB, so: MaxSize x 2^20)
				MaxSize uint `kv:"max-size"`

				// List of mime-types we support,
				Mimetypes []string
			}
		}

		// Icon related settings
		Icon struct {
			// @todo implementation
			Attachments struct {
				// What is max size (in MB, so: MaxSize x 2^20)
				MaxSize uint `kv:"max-size"`

				// List of mime-types we support,
				Mimetypes []string
			}
		}
	} `kv:"compose" json:"compose"`

	// Federation settings
	Federation struct {
		// This only holds the value of FEDERATION_ENABLED for now
		//
		Enabled bool `kv:"-" json:"enabled"`
	} `kv:"federation" json:"federation"`

	// Integration gateway settings
	Apigw ApigwSettings `kv:"apigw" json:"apigw"`

	CodeSnippets []struct{ CodeSnippet } `kv:"code-snippets" json:"codeSnippets"`

	// UserInterface settings
	UI struct {
		MainLogo string `kv:"main-logo" json:"mainLogo"`
		IconLogo string `kv:"icon-logo" json:"iconLogo"`

		Sidebar struct {
			// General sidebar settings
			Disabled bool `json:"disabled"`
		} `kv:"sidebar,final" json:"sidebar"`

		Studio struct {
			Themes    []struct{ Theme } `kv:"themes" json:"themes"`
			CustomCSS []struct{ Theme } `kv:"custom-css" json:"customCSS"`
		} `kv:"studio" json:"studio"`

		Topbar struct {
			HideAppSelector        bool `json:"hideAppSelector"`
			HideHelp               bool `json:"hideHelp"`
			HideForumLink          bool `json:"hideForumLink"`
			HideDocumentationLink  bool `json:"hideDocumentationLink"`
			HideFeedbackLink       bool `json:"hideFeedbackLink"`
			HideProfile            bool `json:"hideProfile"`
			HideChangePasswordLink bool `json:"hideChangePasswordLink"`
			HideProfileLink        bool `json:"hideProfileLink"`
			HideThemeSelector      bool `json:"hideThemeSelector"`
			HideNotifications      bool `json:"hideNotifications"`
			ShowDrafts             bool `json:"showDrafts"`

			HelpLinks []struct {
				Handle string `json:"handle"`
				URL    string `json:"url"`
				NewTab bool   `json:"newTab"`
			} `json:"helpLinks"`

			ProfileLinks []struct {
				Handle string `json:"handle"`
				URL    string `json:"url"`
				NewTab bool   `json:"newTab"`
			} `json:"profileLinks"`

			PageButtons []struct {
				Label       string `json:"label"`
				URL         string `json:"url"`
				URLMatch    string `json:"urlMatch"`
				NewTab      bool   `json:"newTab"`
				Description string `json:"description"`
			} `json:"pageButtons"`
		} `kv:"topbar,final" json:"topbar"`

		Charts struct {
			ColorSchemes []struct {
				ID     string   `json:"id"`
				Name   string   `json:"name"`
				Colors []string `json:"colors"`
			} `kv:"colorSchemes" json:"colorSchemes"`
		} `kv:"charts" json:"charts"`

		Location struct {
			GeoSearchProvider string `json:"geoSearchProvider"`
			GeoSearchApiKey   string `json:"geoSearchApiKey"`
		} `kv:"location,final" json:"location"`
	} `kv:"ui" json:"ui"`

	ResourceTranslations struct {

		// This is always a subset of all languages available
		// in Human instance (LOCALE_LANGUAGES)
		//
		// Note: later, we will enable this to contain languages
		//       that are not part of LOCALE_LANGUAGES
		//
		// 1st language in the set is also a default one
		//
		// IsEmpty slice defaults to LOCALE_LANGUAGES
		Languages []string `kv:"languages" json:"languages"`
	} `kv:"resource-translations" json:"resourceTranslations"`

	Discovery struct {
		// Enable indexing
		Enabled bool `kv:"enabled" json:"enabled"`

		SystemUsers struct {
			// Enable indexing of users
			Enabled bool `kv:"enabled" json:"enabled"`
		} `kv:"system-users" json:"system-users"`

		SystemApplications struct {
			// Enable indexing of applications
			Enabled bool `kv:"enabled" json:"enabled"`
		} `kv:"system-applications" json:"system-applications"`

		SystemRoles struct {
			// Enable indexing of roles
			Enabled bool `kv:"enabled" json:"enabled"`
		} `kv:"system-roles" json:"system-roles"`

		SystemTemplates struct {
			// Enable indexing of templates
			Enabled bool `kv:"enabled" json:"enabled"`
		} `kv:"system-templates" json:"system-templates"`

		AutomationWorkflows struct {
			// Enable indexing of workflows
			Enabled bool `kv:"enabled" json:"enabled"`
		} `kv:"automation-workflows" json:"automation-workflows"`

		ComposeNamespaces struct {
			// Enable indexing of compose namespaces
			Enabled bool `kv:"enabled" json:"enabled"`
		} `kv:"compose-namespaces" json:"compose-namespaces"`

		ComposeCharts struct {
			// Enable indexing of compose charts
			Enabled bool `kv:"enabled" json:"enabled"`
		} `kv:"compose-charts" json:"compose-charts"`

		ComposePages struct {
			// Enable indexing of compose pages
			Enabled bool `kv:"enabled" json:"enabled"`
		} `kv:"compose-pages" json:"compose-pages"`

		ComposeModules struct {
			// Enable indexing of compose modules
			Enabled bool `kv:"enabled" json:"enabled"`
		} `kv:"compose-modules" json:"compose-modules"`

		ComposeRecords struct {
			// Enable indexing of compose records
			Enabled bool `kv:"enabled" json:"enabled"`
		} `kv:"compose-records" json:"compose-records"`
	} `kv:"discovery" json:"discovery"`
}

AppSettings type is structured representation of all application settings

Raw settings keys are hyphen (kebab) case, separated with a dot (.) that indicates sub-level JSON properties for settings are NOT converted (lower-cased, etc...) Use `json:"-"` tag to hide settings on REST endpoint

func (AppSettings) WithDefaults

func (cs AppSettings) WithDefaults() *AppSettings

WithDefaults sets defaults on copy (!!) of settings to avoid any unintended corruption or leaks

type Application

type Application struct {
	ID      uint64 `json:"applicationID,string"`
	Name    string `json:"name"`
	OwnerID uint64 `json:"ownerID"`
	Enabled bool   `json:"enabled"`
	Weight  int    `json:"weight"`

	Unify *ApplicationUnify `json:"unify,omitempty"`

	Labels map[string]labelTypes.LabelValue `json:"labels,omitempty"`
	Flags  []string                         `json:"flags,omitempty"`

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
}

func (*Application) FlagResourceID

func (a *Application) FlagResourceID() uint64

GetLabels adds new label to label map

func (*Application) FlagResourceKind

func (*Application) FlagResourceKind() string

FlagResourceKind returns the resource kind for the flag

func (*Application) GetFlags

func (a *Application) GetFlags() []string

GetFlags returns current flags on the resource

func (Application) GetID

func (r Application) GetID() uint64

func (Application) GetLabels

func (m Application) GetLabels() map[string]labelTypes.LabelValue

GetLabels adds new label to label map

func (*Application) GetValue

func (r *Application) GetValue(name string, pos uint) (any, error)

func (Application) LabelResourceID

func (m Application) LabelResourceID() uint64

GetLabels adds new label to label map

func (Application) LabelResourceKind

func (Application) LabelResourceKind() string

GetLabels adds new label to label map

func (Application) RbacResource

func (r Application) RbacResource() string

RbacResource returns string representation of RBAC resource for Application by calling ApplicationRbacResource fn

RBAC resource is in the corteza::system:application/... format

This function is auto-generated

func (*Application) SetFlags

func (a *Application) SetFlags(flags []string)

SetFlags adds new label to label map

func (*Application) SetLabel

func (m *Application) SetLabel(key string, value labelTypes.LabelValue)

SetLabel adds new label to label map

func (*Application) SetValue

func (r *Application) SetValue(name string, pos uint, value any) (err error)

func (*Application) Valid

func (a *Application) Valid() bool

type ApplicationFilter

type ApplicationFilter struct {
	ApplicationID []string `json:"applicationID"`
	Name          string   `json:"name"`
	Query         string   `json:"query"`

	LabeledIDs []uint64                         `json:"-"`
	Labels     map[string]labelTypes.LabelValue `json:"labels,omitempty"`

	FlaggedIDs []uint64 `json:"-"`
	Flags      []string `json:"flags,omitempty"`
	IncFlags   uint     `json:"-"`

	Deleted filter.State `json:"deleted"`

	// Check fn is called by store backend for each resource found function can
	// modify the resource and return false if store should not return it
	//
	// Store then loads additional resources to satisfy the paging parameters
	Check func(*Application) (bool, error) `json:"-"`

	// Standard helpers for paging and sorting
	filter.Sorting
	filter.Paging
}

type ApplicationMetrics

type ApplicationMetrics struct {
	Total   uint `json:"total"`
	Deleted uint `json:"deleted"`
	Valid   uint `json:"valid"`
}

type ApplicationSet

type ApplicationSet []*Application

ApplicationSet slice of Application

This type is auto-generated.

func (ApplicationSet) Filter

func (set ApplicationSet) Filter(f func(*Application) (bool, error)) (out ApplicationSet, err error)

Filter iterates through every slice item, calls f(Application) (bool, err) and return filtered slice

This function is auto-generated.

func (ApplicationSet) FindByID

func (set ApplicationSet) FindByID(ID uint64) *Application

FindByID finds items from slice by its ID property

This function is auto-generated.

func (ApplicationSet) IDs

func (set ApplicationSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (ApplicationSet) Walk

func (set ApplicationSet) Walk(w func(*Application) error) (err error)

Walk iterates through every slice item and calls w(Application) err

This function is auto-generated.

type ApplicationUnify

type ApplicationUnify struct {
	Name   string `json:"name,omitempty"`
	Listed bool   `json:"listed"`
	Url    string `json:"url"`
	Config string `json:"config"`

	// Temporary icon & logo URLs
	// @todo rework this when we rework attachment management
	Icon   string `json:"icon,omitempty"`
	IconID uint64 `json:"iconID,string"`
	LogoID uint64 `json:"logoID,string"`
}

func (*ApplicationUnify) Scan

func (au *ApplicationUnify) Scan(src any) error

func (ApplicationUnify) Value

func (au ApplicationUnify) Value() (driver.Value, error)

type Attachment

type Attachment struct {
	ID         uint64         `json:"attachmentID,string"`
	OwnerID    uint64         `json:"ownerID,string"`
	Kind       string         `json:"-"`
	Url        string         `json:"url,omitempty"`
	PreviewUrl string         `json:"previewUrl,omitempty"`
	Name       string         `json:"name,omitempty"`
	Meta       AttachmentMeta `json:"meta"`

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
}

func (Attachment) GetID

func (r Attachment) GetID() uint64

func (*Attachment) GetValue

func (r *Attachment) GetValue(name string, pos uint) (any, error)

func (*Attachment) SetOriginalImageMeta

func (a *Attachment) SetOriginalImageMeta(width, height int, animated bool) *AttachmentFileMeta

func (*Attachment) SetPreviewImageMeta

func (a *Attachment) SetPreviewImageMeta(width, height int, animated bool) *AttachmentFileMeta

func (*Attachment) SetValue

func (r *Attachment) SetValue(name string, pos uint, value any) (err error)

type AttachmentFileMeta

type AttachmentFileMeta struct {
	Size      int64                `json:"size"`
	Extension string               `json:"ext"`
	Mimetype  string               `json:"mimetype"`
	Image     *AttachmentImageMeta `json:"image,omitempty"`
}

type AttachmentFilter

type AttachmentFilter struct {
	Kind   string `json:"kind,omitempty"`
	Filter string `json:"filter"`

	// Check fn is called by store backend for each resource found function can
	// modify the resource and return false if store should not return it
	//
	// Store then loads additional resources to satisfy the paging parameters
	Check func(*Attachment) (bool, error) `json:"-"`

	// Standard helpers for paging and sorting
	filter.Sorting
	filter.Paging
}

AttachmentFilter is used for filtering and as a return value from Find

type AttachmentImageMeta

type AttachmentImageMeta struct {
	Width           int    `json:"width,omitempty"`
	Height          int    `json:"height,omitempty"`
	Animated        bool   `json:"animated"`
	Initial         string `json:"initial,omitempty"`
	InitialColor    string `json:"initial-color,omitempty"`
	BackgroundColor string `json:"background-color,omitempty"`
}

type AttachmentMeta

type AttachmentMeta struct {
	Original AttachmentFileMeta  `json:"original"`
	Preview  *AttachmentFileMeta `json:"preview,omitempty"`
	Labels   map[string]string   `json:"labels,omitempty"`
}

func (*AttachmentMeta) Scan

func (meta *AttachmentMeta) Scan(src any) error

func (AttachmentMeta) Value

func (meta AttachmentMeta) Value() (driver.Value, error)

type AttachmentSet

type AttachmentSet []*Attachment

AttachmentSet slice of Attachment

This type is auto-generated.

func (AttachmentSet) Filter

func (set AttachmentSet) Filter(f func(*Attachment) (bool, error)) (out AttachmentSet, err error)

Filter iterates through every slice item, calls f(Attachment) (bool, err) and return filtered slice

This function is auto-generated.

func (AttachmentSet) FindByID

func (set AttachmentSet) FindByID(ID uint64) *Attachment

FindByID finds items from slice by its ID property

This function is auto-generated.

func (AttachmentSet) IDs

func (set AttachmentSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (AttachmentSet) Walk

func (set AttachmentSet) Walk(w func(*Attachment) error) (err error)

Walk iterates through every slice item and calls w(Attachment) err

This function is auto-generated.

type AuthClient

type AuthClient struct {
	ID uint64 `json:"authClientID,string"`

	// Client's handle
	Handle string `json:"handle"`

	// Client's meta data, see comments on AuthClientMeta
	Meta *AuthClientMeta `json:"meta,omitempty"`

	// Client secret
	Secret string `json:"secret,omitempty"`

	Scope string `json:"scope"`

	// valid grant for this client (only one)
	//  - authorization_code
	//  - client_credentials
	ValidGrant string `json:"validGrant"`

	// Valid redirection URIs
	RedirectURI string `json:"redirectURI"`

	// Users will not be prompted to confirm the client after login
	Trusted bool `json:"trusted"`

	// Can client be used for authentication
	Enabled bool `json:"enabled"`

	// Is client valid yet?
	ValidFrom *time.Time `json:"validFrom,omitempty"`

	// Is client still valid
	ExpiresAt *time.Time `json:"expiresAt,omitempty"`

	// Role-specific settings, see comments on AuthClientSecurity
	Security *AuthClientSecurity `json:"security"`

	// Auth client labels
	Labels map[string]labelTypes.LabelValue `json:"labels,omitempty"`

	OwnedBy   uint64     `json:"ownedBy"`
	CreatedBy uint64     `json:"createdBy"`
	CreatedAt time.Time  `json:"createdAt"`
	UpdatedBy uint64     `json:"updatedBy,omitempty"`
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	DeletedBy uint64     `json:"deletedBy,omitempty"`
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
}

func (AuthClient) Dict

func (r AuthClient) Dict() map[string]interface{}

func (AuthClient) GetID

func (r AuthClient) GetID() uint64

func (AuthClient) GetLabels

func (m AuthClient) GetLabels() map[string]labelTypes.LabelValue

GetLabels adds new label to label map

func (*AuthClient) GetValue

func (r *AuthClient) GetValue(name string, pos uint) (any, error)

func (AuthClient) LabelResourceID

func (m AuthClient) LabelResourceID() uint64

GetLabels adds new label to label map

func (AuthClient) LabelResourceKind

func (AuthClient) LabelResourceKind() string

GetLabels adds new label to label map

func (AuthClient) RbacResource

func (r AuthClient) RbacResource() string

RbacResource returns string representation of RBAC resource for AuthClient by calling AuthClientRbacResource fn

RBAC resource is in the corteza::system:auth-client/... format

This function is auto-generated

func (*AuthClient) SetLabel

func (m *AuthClient) SetLabel(key string, value labelTypes.LabelValue)

SetLabel adds new label to label map

func (*AuthClient) SetValue

func (r *AuthClient) SetValue(name string, pos uint, value any) (err error)

func (*AuthClient) String

func (r *AuthClient) String() string

func (*AuthClient) Verify

func (r *AuthClient) Verify() error

type AuthClientFilter

type AuthClientFilter struct {
	AuthClientID []string `json:"authClientID"`

	Handle string `json:"handle"`

	Deleted filter.State `json:"deleted"`

	LabeledIDs []uint64                         `json:"-"`
	Labels     map[string]labelTypes.LabelValue `json:"labels,omitempty"`

	// Check fn is called by store backend for each resource found function can
	// modify the resource and return false if store should not return it
	//
	// Store then loads additional resources to satisfy the paging parameters
	Check func(*AuthClient) (bool, error) `json:"-"`

	// Standard helpers for paging and sorting
	filter.Sorting
	filter.Paging
}

type AuthClientMeta

type AuthClientMeta struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

func ParseAuthClientMeta

func ParseAuthClientMeta(ss []string) (p *AuthClientMeta, err error)

func (*AuthClientMeta) Scan

func (vv *AuthClientMeta) Scan(src any) error

func (*AuthClientMeta) Value

func (vv *AuthClientMeta) Value() (driver.Value, error)

type AuthClientSecurity

type AuthClientSecurity struct {
	// Impersonates a specific user;
	// ignored when non client-credentials grant is used
	ImpersonateUser uint64 `json:"impersonateUser,string,omitempty"`

	// The default user group the user falls into
	UserGroup uint64 `json:"userGroup,string,omitempty"`

	// Subset of roles, permitted to be used with this client
	// IDs are intentionally stored as strings to support JS (int64 only)
	PermittedRoles []string `json:"permittedRoles,omitempty"`

	// Subset of roles, prohibited to be used with this client
	// IDs are intentionally stored as strings to support JS (int64 only)
	ProhibitedRoles []string `json:"prohibitedRoles,omitempty"`

	// Set of additional roles that are forced on this user
	// IDs are intentionally stored as strings to support JS (int64 only)
	ForcedRoles []string `json:"forcedRoles,omitempty"`
}

func ParseAuthClientSecurity

func ParseAuthClientSecurity(ss []string) (p *AuthClientSecurity, err error)

func (*AuthClientSecurity) Scan

func (vv *AuthClientSecurity) Scan(src any) error

func (*AuthClientSecurity) Value

func (vv *AuthClientSecurity) Value() (driver.Value, error)

type AuthClientSet

type AuthClientSet []*AuthClient

AuthClientSet slice of AuthClient

This type is auto-generated.

func (AuthClientSet) Filter

func (set AuthClientSet) Filter(f func(*AuthClient) (bool, error)) (out AuthClientSet, err error)

Filter iterates through every slice item, calls f(AuthClient) (bool, err) and return filtered slice

This function is auto-generated.

func (AuthClientSet) FindByHandle

func (set AuthClientSet) FindByHandle(handle string) *AuthClient

FindByHandle finds authClient by it's handle

func (AuthClientSet) FindByID

func (set AuthClientSet) FindByID(ID uint64) *AuthClient

FindByID finds items from slice by its ID property

This function is auto-generated.

func (AuthClientSet) IDs

func (set AuthClientSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (AuthClientSet) Walk

func (set AuthClientSet) Walk(w func(*AuthClient) error) (err error)

Walk iterates through every slice item and calls w(AuthClient) err

This function is auto-generated.

type AuthConfirmedClient

type AuthConfirmedClient struct {
	UserID      uint64
	ClientID    uint64
	ConfirmedAt time.Time
}

type AuthConfirmedClientFilter

type AuthConfirmedClientFilter struct {
	UserID uint64
	Limit  uint
}

type AuthConfirmedClientSet

type AuthConfirmedClientSet []*AuthConfirmedClient

AuthConfirmedClientSet slice of AuthConfirmedClient

This type is auto-generated.

func (AuthConfirmedClientSet) Filter

Filter iterates through every slice item, calls f(AuthConfirmedClient) (bool, err) and return filtered slice

This function is auto-generated.

func (AuthConfirmedClientSet) Walk

func (set AuthConfirmedClientSet) Walk(w func(*AuthConfirmedClient) error) (err error)

Walk iterates through every slice item and calls w(AuthConfirmedClient) err

This function is auto-generated.

type AuthOa2token

type AuthOa2token struct {
	ID         uint64
	Code       string
	Access     string
	Refresh    string
	ExpiresAt  time.Time
	CreatedAt  time.Time
	Data       sqlxTypes.JSONText
	ClientID   uint64
	UserID     uint64
	RemoteAddr string
	UserAgent  string
}

type AuthOa2tokenFilter

type AuthOa2tokenFilter struct {
	UserID uint64
	Limit  uint
}

type AuthOa2tokenSet

type AuthOa2tokenSet []*AuthOa2token

AuthOa2tokenSet slice of AuthOa2token

This type is auto-generated.

func (AuthOa2tokenSet) Filter

func (set AuthOa2tokenSet) Filter(f func(*AuthOa2token) (bool, error)) (out AuthOa2tokenSet, err error)

Filter iterates through every slice item, calls f(AuthOa2token) (bool, err) and return filtered slice

This function is auto-generated.

func (AuthOa2tokenSet) FindByID

func (set AuthOa2tokenSet) FindByID(ID uint64) *AuthOa2token

FindByID finds items from slice by its ID property

This function is auto-generated.

func (AuthOa2tokenSet) IDs

func (set AuthOa2tokenSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (AuthOa2tokenSet) Walk

func (set AuthOa2tokenSet) Walk(w func(*AuthOa2token) error) (err error)

Walk iterates through every slice item and calls w(AuthOa2token) err

This function is auto-generated.

type AuthProvider

type AuthProvider struct {
	Provider string
}

type AuthSession

type AuthSession struct {
	ID         string
	Data       []byte
	ExpiresAt  time.Time
	CreatedAt  time.Time
	UserID     uint64
	RemoteAddr string
	UserAgent  string
}

type AuthSessionFilter

type AuthSessionFilter struct {
	UserID uint64
	Limit  uint
}

type AuthSessionSet

type AuthSessionSet []*AuthSession

AuthSessionSet slice of AuthSession

This type is auto-generated.

func (AuthSessionSet) Filter

func (set AuthSessionSet) Filter(f func(*AuthSession) (bool, error)) (out AuthSessionSet, err error)

Filter iterates through every slice item, calls f(AuthSession) (bool, err) and return filtered slice

This function is auto-generated.

func (AuthSessionSet) Walk

func (set AuthSessionSet) Walk(w func(*AuthSession) error) (err error)

Walk iterates through every slice item and calls w(AuthSession) err

This function is auto-generated.

type ByContentLength

type ByContentLength ApigwProfilerHitSet

sorting methods

func (ByContentLength) Len

func (h ByContentLength) Len() int

func (ByContentLength) Less

func (h ByContentLength) Less(i, j int) bool

func (ByContentLength) Swap

func (h ByContentLength) Swap(i, j int)

type ByCount

sorting methods

func (ByCount) Len

func (h ByCount) Len() int

func (ByCount) Less

func (h ByCount) Less(i, j int) bool

func (ByCount) Swap

func (h ByCount) Swap(i, j int)

type ByDuration

type ByDuration ApigwProfilerHitSet

sorting methods

func (ByDuration) Len

func (h ByDuration) Len() int

func (ByDuration) Less

func (h ByDuration) Less(i, j int) bool

func (ByDuration) Swap

func (h ByDuration) Swap(i, j int)

type ByFTime

type ByFTime ApigwProfilerHitSet

sorting methods

func (ByFTime) Len

func (h ByFTime) Len() int

func (ByFTime) Less

func (h ByFTime) Less(i, j int) bool

func (ByFTime) Swap

func (h ByFTime) Swap(i, j int)

type ByMethod

type ByMethod ApigwProfilerHitSet

sorting methods

func (ByMethod) Len

func (h ByMethod) Len() int

func (ByMethod) Less

func (h ByMethod) Less(i, j int) bool

func (ByMethod) Swap

func (h ByMethod) Swap(i, j int)

type ByPath

sorting methods

func (ByPath) Len

func (h ByPath) Len() int

func (ByPath) Less

func (h ByPath) Less(i, j int) bool

func (ByPath) Swap

func (h ByPath) Swap(i, j int)

type BySTime

type BySTime ApigwProfilerHitSet

sorting methods

func (BySTime) Len

func (h BySTime) Len() int

Sorting hits

func (BySTime) Less

func (h BySTime) Less(i, j int) bool

func (BySTime) Swap

func (h BySTime) Swap(i, j int)

type BySizeAvg

sorting methods

func (BySizeAvg) Len

func (h BySizeAvg) Len() int

func (BySizeAvg) Less

func (h BySizeAvg) Less(i, j int) bool

func (BySizeAvg) Swap

func (h BySizeAvg) Swap(i, j int)

type BySizeMax

sorting methods

func (BySizeMax) Len

func (h BySizeMax) Len() int

func (BySizeMax) Less

func (h BySizeMax) Less(i, j int) bool

func (BySizeMax) Swap

func (h BySizeMax) Swap(i, j int)

type BySizeMin

sorting methods

func (BySizeMin) Len

func (h BySizeMin) Len() int

func (BySizeMin) Less

func (h BySizeMin) Less(i, j int) bool

func (BySizeMin) Swap

func (h BySizeMin) Swap(i, j int)

type ByStatus

type ByStatus ApigwProfilerHitSet

sorting methods

func (ByStatus) Len

func (h ByStatus) Len() int

func (ByStatus) Less

func (h ByStatus) Less(i, j int) bool

func (ByStatus) Swap

func (h ByStatus) Swap(i, j int)

type ByTimeAvg

sorting methods

func (ByTimeAvg) Len

func (h ByTimeAvg) Len() int

func (ByTimeAvg) Less

func (h ByTimeAvg) Less(i, j int) bool

func (ByTimeAvg) Swap

func (h ByTimeAvg) Swap(i, j int)

type ByTimeMax

sorting methods

func (ByTimeMax) Len

func (h ByTimeMax) Len() int

func (ByTimeMax) Less

func (h ByTimeMax) Less(i, j int) bool

func (ByTimeMax) Swap

func (h ByTimeMax) Swap(i, j int)

type ByTimeMin

sorting methods

func (ByTimeMin) Len

func (h ByTimeMin) Len() int

func (ByTimeMin) Less

func (h ByTimeMin) Less(i, j int) bool

func (ByTimeMin) Swap

func (h ByTimeMin) Swap(i, j int)

type Chatbot

type Chatbot struct {
	ID      uint64 `json:"chatbotID,string"`
	Handle  string `json:"handle"`
	Name    string `json:"name"`
	Enabled bool   `json:"enabled"`

	WidgetKey      string                `json:"widgetKey,omitempty"`
	AllowedOrigins ChatbotAllowedOrigins `json:"allowedOrigins,omitempty"`
	SessionTTL     string                `json:"sessionTTL,omitempty"`

	Handoff   ChatbotHandoff   `json:"handoff"`
	Styling   ChatbotStyling   `json:"styling"`
	Scenarios ChatbotScenarios `json:"scenarios"`

	Labels map[string]labelTypes.LabelValue `json:"labels,omitempty"`

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	CreatedBy uint64     `json:"createdBy,string"`
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	UpdatedBy uint64     `json:"updatedBy,string,omitempty"`
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
	DeletedBy uint64     `json:"deletedBy,string,omitempty"`
}

func (Chatbot) GetID

func (r Chatbot) GetID() uint64

func (Chatbot) GetLabels

func (m Chatbot) GetLabels() map[string]labelTypes.LabelValue

GetLabels adds new label to label map

func (*Chatbot) GetValue

func (r *Chatbot) GetValue(name string, pos uint) (any, error)

func (Chatbot) LabelResourceID

func (m Chatbot) LabelResourceID() uint64

GetLabels adds new label to label map

func (Chatbot) LabelResourceKind

func (Chatbot) LabelResourceKind() string

GetLabels adds new label to label map

func (Chatbot) RbacResource

func (r Chatbot) RbacResource() string

RbacResource returns string representation of RBAC resource for Chatbot by calling ChatbotRbacResource fn

RBAC resource is in the corteza::system:chatbot/... format

This function is auto-generated

func (*Chatbot) SetLabel

func (m *Chatbot) SetLabel(key string, value labelTypes.LabelValue)

SetLabel adds new label to label map

func (*Chatbot) SetValue

func (r *Chatbot) SetValue(name string, pos uint, value any) (err error)

type ChatbotAllowedOrigins

type ChatbotAllowedOrigins []string

func ParseChatbotAllowedOrigins

func ParseChatbotAllowedOrigins(ss []string) (p ChatbotAllowedOrigins, err error)

func (*ChatbotAllowedOrigins) Scan

func (m *ChatbotAllowedOrigins) Scan(src any) error

func (ChatbotAllowedOrigins) Value

func (m ChatbotAllowedOrigins) Value() (driver.Value, error)

type ChatbotAutomationHook

type ChatbotAutomationHook struct {
	Automation string               `json:"automation"`
	Async      bool                 `json:"async"`
	Mappings   []ChatbotHookMapping `json:"mappings,omitempty"`
}

type ChatbotColors

type ChatbotColors struct {
	Primary     string `json:"primary,omitempty"`
	PrimaryText string `json:"primaryText,omitempty"`
	Header      string `json:"header,omitempty"`
	HeaderText  string `json:"headerText,omitempty"`
	Background  string `json:"background,omitempty"`
	Text        string `json:"text,omitempty"`
	UserBubble  string `json:"userBubble,omitempty"`
	AgentBubble string `json:"agentBubble,omitempty"`
}

type ChatbotConsentStepState

type ChatbotConsentStepState struct {
	Accepted bool      `json:"accepted"`
	At       time.Time `json:"at"`
}

ChatbotConsentStepState captures the visitor's response to a consent step (e.g. TOS acceptance) for audit purposes. Decision is final per step; At is set to the server-side timestamp at submit time.

type ChatbotConversationHandoffState

type ChatbotConversationHandoffState struct {
	OperatorID   uint64 `json:"operatorID,string,omitempty"`
	OperatorName string `json:"operatorName,omitempty"`
}

type ChatbotConversationStepState

type ChatbotConversationStepState struct {
	ConversationID uint64                           `json:"conversationID,string,omitempty"`
	History        []AiConversationMessage          `json:"history,omitempty"`
	Handoff        *ChatbotConversationHandoffState `json:"handoff,omitempty"`
}

type ChatbotFilter

type ChatbotFilter struct {
	ChatbotID []string `json:"chatbotID"`
	Handle    string   `json:"handle"`
	WidgetKey string   `json:"widgetKey"`
	Query     string   `json:"query"`

	Deleted filter.State `json:"deleted"`

	LabeledIDs []uint64                         `json:"-"`
	Labels     map[string]labelTypes.LabelValue `json:"labels,omitempty"`

	Check func(*Chatbot) (bool, error) `json:"-"`

	filter.Sorting
	filter.Paging
}

type ChatbotFontSizes

type ChatbotFontSizes struct {
	Base    string `json:"base,omitempty"`
	Small   string `json:"small,omitempty"`
	Heading string `json:"heading,omitempty"`
}

type ChatbotFormStepState

type ChatbotFormStepState struct {
	Fields    map[string]string `json:"fields,omitempty"`
	Submitted bool              `json:"submitted,omitempty"`
}

type ChatbotHandoff

type ChatbotHandoff struct {
	Enabled    bool                     `json:"enabled"`
	Automation ChatbotHandoffAutomation `json:"automation"`
}

func ParseChatbotHandoff

func ParseChatbotHandoff(ss []string) (p ChatbotHandoff, err error)

func (*ChatbotHandoff) Scan

func (m *ChatbotHandoff) Scan(src any) error

func (ChatbotHandoff) Value

func (m ChatbotHandoff) Value() (driver.Value, error)

type ChatbotHandoffAutomation

type ChatbotHandoffAutomation struct {
	OnRequested ChatbotAutomationHook `json:"onRequested"`
	OnAccepted  ChatbotAutomationHook `json:"onAccepted"`
}

type ChatbotHookMapping

type ChatbotHookMapping struct {
	StateExpression ChatbotStateExpression `json:"stateExpression"`
	TriggerParam    string                 `json:"triggerParam"`
}

ChatbotHookMapping maps a chatbot session state expression to a TAQ trigger input param. StateExpression mirrors automation/types.Expr (circular import prevents direct use).

type ChatbotLauncher

type ChatbotLauncher struct {
	IconURL          string `json:"iconURL,omitempty"`
	IconAttachmentID uint64 `json:"iconAttachmentID,string,omitempty"`
	IconVisible      bool   `json:"iconVisible"`
	Label            string `json:"label,omitempty"`
	ButtonLabel      string `json:"buttonLabel,omitempty"`
	Size             string `json:"size,omitempty"`
	Shape            string `json:"shape,omitempty"`
	Position         string `json:"position,omitempty"`
	StartOpen        bool   `json:"startOpen,omitempty"`
}

type ChatbotScenario

type ChatbotScenario struct {
	ID         string                    `json:"id"`
	Name       string                    `json:"name,omitempty"`
	Type       string                    `json:"type"`
	AgentID    uint64                    `json:"agentID,string,omitempty"`
	Config     json.RawMessage           `json:"config,omitempty"`
	Automation ChatbotScenarioAutomation `json:"automation"`
}

type ChatbotScenarioAutomation

type ChatbotScenarioAutomation struct {
	Before ChatbotAutomationHook `json:"before"`
	After  ChatbotAutomationHook `json:"after"`
}

type ChatbotScenarios

type ChatbotScenarios []ChatbotScenario

func ParseChatbotScenarios

func ParseChatbotScenarios(ss []string) (p ChatbotScenarios, err error)

func (*ChatbotScenarios) Scan

func (m *ChatbotScenarios) Scan(src any) error

func (ChatbotScenarios) Value

func (m ChatbotScenarios) Value() (driver.Value, error)

type ChatbotSession

type ChatbotSession struct {
	ID          uint64              `json:"id,string"`
	ChatbotID   uint64              `json:"chatbotID,string"`
	Status      string              `json:"status"`
	CurrentStep int                 `json:"currentStep"`
	State       ChatbotSessionState `json:"state,omitempty"`
	CreatedAt   time.Time           `json:"createdAt,omitempty"`
	CreatedBy   uint64              `json:"createdBy,string"`
	UpdatedAt   *time.Time          `json:"updatedAt,omitempty"`
	UpdatedBy   uint64              `json:"updatedBy,string,omitempty"`
	DeletedAt   *time.Time          `json:"deletedAt,omitempty"`
	DeletedBy   uint64              `json:"deletedBy,string,omitempty"`
}

func (ChatbotSession) GetID

func (r ChatbotSession) GetID() uint64

func (*ChatbotSession) GetValue

func (r *ChatbotSession) GetValue(name string, pos uint) (any, error)

func (ChatbotSession) RbacResource

func (r ChatbotSession) RbacResource() string

RbacResource returns string representation of RBAC resource for ChatbotSession by calling ChatbotSessionRbacResource fn

RBAC resource is in the corteza::system:chatbot-session/... format

This function is auto-generated

func (*ChatbotSession) SetValue

func (r *ChatbotSession) SetValue(name string, pos uint, value any) (err error)

type ChatbotSessionFilter

type ChatbotSessionFilter struct {
	ChatbotSessionID []uint64 `json:"chatbotSessionID"`
	ChatbotID        uint64   `json:"chatbotID"`
	Status           []string `json:"status"`
	Query            string   `json:"query"`

	Deleted filter.State `json:"deleted"`

	Check func(*ChatbotSession) (bool, error) `json:"-"`

	filter.Sorting
	filter.Paging
}

type ChatbotSessionHandoff

type ChatbotSessionHandoff struct {
	ID          uint64     `json:"id,string"`
	SessionID   uint64     `json:"sessionID,string"`
	StepID      uint64     `json:"stepID,string"`
	Status      string     `json:"status"`
	InitiatedAt time.Time  `json:"initiatedAt,omitempty"`
	ClosedAt    *time.Time `json:"closedAt,omitempty"`
	CreatedAt   time.Time  `json:"createdAt,omitempty"`
	CreatedBy   uint64     `json:"createdBy,string"`
	UpdatedAt   *time.Time `json:"updatedAt,omitempty"`
	UpdatedBy   uint64     `json:"updatedBy,string,omitempty"`
	DeletedAt   *time.Time `json:"deletedAt,omitempty"`
	DeletedBy   uint64     `json:"deletedBy,string,omitempty"`
}

func (ChatbotSessionHandoff) GetID

func (r ChatbotSessionHandoff) GetID() uint64

func (*ChatbotSessionHandoff) GetValue

func (r *ChatbotSessionHandoff) GetValue(name string, pos uint) (any, error)

func (ChatbotSessionHandoff) RbacResource

func (r ChatbotSessionHandoff) RbacResource() string

RbacResource returns string representation of RBAC resource for ChatbotSessionHandoff by calling ChatbotSessionHandoffRbacResource fn

RBAC resource is in the corteza::system:chatbot-session-handoff/... format

This function is auto-generated

func (*ChatbotSessionHandoff) SetValue

func (r *ChatbotSessionHandoff) SetValue(name string, pos uint, value any) (err error)

type ChatbotSessionHandoffFilter

type ChatbotSessionHandoffFilter struct {
	ChatbotSessionHandoffID []uint64 `json:"chatbotSessionHandoffID"`
	SessionID               uint64   `json:"sessionID"`
	StepID                  uint64   `json:"stepID"`
	Status                  string   `json:"status"`
	Query                   string   `json:"query"`

	Deleted filter.State `json:"deleted"`

	Check func(*ChatbotSessionHandoff) (bool, error) `json:"-"`

	filter.Sorting
	filter.Paging
}

type ChatbotSessionHandoffSet

type ChatbotSessionHandoffSet []*ChatbotSessionHandoff

ChatbotSessionHandoffSet slice of ChatbotSessionHandoff

This type is auto-generated.

func (ChatbotSessionHandoffSet) Filter

Filter iterates through every slice item, calls f(ChatbotSessionHandoff) (bool, err) and return filtered slice

This function is auto-generated.

func (ChatbotSessionHandoffSet) FindByID

FindByID finds items from slice by its ID property

This function is auto-generated.

func (ChatbotSessionHandoffSet) IDs

func (set ChatbotSessionHandoffSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (ChatbotSessionHandoffSet) Walk

func (set ChatbotSessionHandoffSet) Walk(w func(*ChatbotSessionHandoff) error) (err error)

Walk iterates through every slice item and calls w(ChatbotSessionHandoff) err

This function is auto-generated.

type ChatbotSessionSet

type ChatbotSessionSet []*ChatbotSession

ChatbotSessionSet slice of ChatbotSession

This type is auto-generated.

func (ChatbotSessionSet) Filter

func (set ChatbotSessionSet) Filter(f func(*ChatbotSession) (bool, error)) (out ChatbotSessionSet, err error)

Filter iterates through every slice item, calls f(ChatbotSession) (bool, err) and return filtered slice

This function is auto-generated.

func (ChatbotSessionSet) FindByID

func (set ChatbotSessionSet) FindByID(ID uint64) *ChatbotSession

FindByID finds items from slice by its ID property

This function is auto-generated.

func (ChatbotSessionSet) IDs

func (set ChatbotSessionSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (ChatbotSessionSet) Walk

func (set ChatbotSessionSet) Walk(w func(*ChatbotSession) error) (err error)

Walk iterates through every slice item and calls w(ChatbotSession) err

This function is auto-generated.

type ChatbotSessionState

type ChatbotSessionState []ChatbotSessionStepState

ChatbotSessionState is per-scenario state for a session. Discriminated by Type — only the matching sub-field is populated. Stored as a JSON blob on the chatbot_sessions row.

func (ChatbotSessionState) ForScenario

func (s ChatbotSessionState) ForScenario(scenarioID string) *ChatbotSessionStepState

ForScenario returns the existing per-scenario state entry, or nil.

func (*ChatbotSessionState) Scan

func (s *ChatbotSessionState) Scan(src any) error

func (*ChatbotSessionState) Upsert

func (s *ChatbotSessionState) Upsert(scenarioID, typ string) *ChatbotSessionStepState

Upsert returns the entry for scenarioID, creating it (with the given type) if missing. Returned pointer is valid for in-place mutation.

func (ChatbotSessionState) Value

func (s ChatbotSessionState) Value() (driver.Value, error)

type ChatbotSessionStep

type ChatbotSessionStep struct {
	ID             uint64     `json:"id,string"`
	SessionID      uint64     `json:"sessionID,string"`
	ScenarioIndex  int        `json:"scenarioIndex"`
	ConversationID uint64     `json:"conversationID,string"`
	Status         string     `json:"status"`
	CreatedAt      time.Time  `json:"createdAt,omitempty"`
	CreatedBy      uint64     `json:"createdBy,string"`
	UpdatedAt      *time.Time `json:"updatedAt,omitempty"`
	UpdatedBy      uint64     `json:"updatedBy,string,omitempty"`
	DeletedAt      *time.Time `json:"deletedAt,omitempty"`
	DeletedBy      uint64     `json:"deletedBy,string,omitempty"`
}

func (ChatbotSessionStep) GetID

func (r ChatbotSessionStep) GetID() uint64

func (*ChatbotSessionStep) GetValue

func (r *ChatbotSessionStep) GetValue(name string, pos uint) (any, error)

func (ChatbotSessionStep) RbacResource

func (r ChatbotSessionStep) RbacResource() string

RbacResource returns string representation of RBAC resource for ChatbotSessionStep by calling ChatbotSessionStepRbacResource fn

RBAC resource is in the corteza::system:chatbot-session-step/... format

This function is auto-generated

func (*ChatbotSessionStep) SetValue

func (r *ChatbotSessionStep) SetValue(name string, pos uint, value any) (err error)

type ChatbotSessionStepFilter

type ChatbotSessionStepFilter struct {
	ChatbotSessionStepID []uint64 `json:"chatbotSessionStepID"`
	SessionID            uint64   `json:"sessionID"`
	ConversationID       uint64   `json:"conversationID"`
	Status               string   `json:"status"`
	Query                string   `json:"query"`

	Deleted filter.State `json:"deleted"`

	Check func(*ChatbotSessionStep) (bool, error) `json:"-"`

	filter.Sorting
	filter.Paging
}

type ChatbotSessionStepSet

type ChatbotSessionStepSet []*ChatbotSessionStep

ChatbotSessionStepSet slice of ChatbotSessionStep

This type is auto-generated.

func (ChatbotSessionStepSet) Filter

Filter iterates through every slice item, calls f(ChatbotSessionStep) (bool, err) and return filtered slice

This function is auto-generated.

func (ChatbotSessionStepSet) FindByID

FindByID finds items from slice by its ID property

This function is auto-generated.

func (ChatbotSessionStepSet) IDs

func (set ChatbotSessionStepSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (ChatbotSessionStepSet) Walk

func (set ChatbotSessionStepSet) Walk(w func(*ChatbotSessionStep) error) (err error)

Walk iterates through every slice item and calls w(ChatbotSessionStep) err

This function is auto-generated.

type ChatbotSessionStepState

type ChatbotSessionStepState struct {
	ScenarioID string `json:"scenarioID"`
	Type       string `json:"type"`

	Conversation *ChatbotConversationStepState `json:"conversation,omitempty"`
	Form         *ChatbotFormStepState         `json:"form,omitempty"`
	Consent      *ChatbotConsentStepState      `json:"consent,omitempty"`
}

type ChatbotSet

type ChatbotSet []*Chatbot

ChatbotSet slice of Chatbot

This type is auto-generated.

func (ChatbotSet) Filter

func (set ChatbotSet) Filter(f func(*Chatbot) (bool, error)) (out ChatbotSet, err error)

Filter iterates through every slice item, calls f(Chatbot) (bool, err) and return filtered slice

This function is auto-generated.

func (ChatbotSet) FindByID

func (set ChatbotSet) FindByID(ID uint64) *Chatbot

FindByID finds items from slice by its ID property

This function is auto-generated.

func (ChatbotSet) IDs

func (set ChatbotSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (ChatbotSet) Walk

func (set ChatbotSet) Walk(w func(*Chatbot) error) (err error)

Walk iterates through every slice item and calls w(Chatbot) err

This function is auto-generated.

type ChatbotStateExpression

type ChatbotStateExpression struct {
	Source string      `json:"source,omitempty"`
	Expr   string      `json:"expr,omitempty"`
	Value  interface{} `json:"value,omitempty"`
	Type   string      `json:"type,omitempty"`
}

ChatbotStateExpression holds an expression evaluated against chatbot session/step state. Fields mirror automation/types.Expr Source/Expr/Value/Type for eval compatibility.

type ChatbotStyling

type ChatbotStyling struct {
	LogoAttachmentID uint64           `json:"logoAttachmentID,string,omitempty"`
	LogoURL          string           `json:"logoURL,omitempty"` // computed at read time; not persisted
	FontFamily       string           `json:"fontFamily,omitempty"`
	FontSizes        ChatbotFontSizes `json:"fontSizes,omitempty"`
	Colors           ChatbotColors    `json:"colors,omitempty"`
	Launcher         ChatbotLauncher  `json:"launcher,omitempty"`
}

func ParseChatbotStyling

func ParseChatbotStyling(ss []string) (p ChatbotStyling, err error)

func (*ChatbotStyling) Scan

func (m *ChatbotStyling) Scan(src any) error

func (ChatbotStyling) Value

func (m ChatbotStyling) Value() (driver.Value, error)

Value strips computed URL fields before persisting. LogoURL/IconURL are derived from the attachmentID at read time; keeping stale values in the DB causes drift when attachments are swapped or regenerated.

type CodeSnippet

type CodeSnippet struct {
	Name    string `json:"name"`
	Script  string `json:"script"`
	Enabled bool   `json:"enabled"`
}

type Component

type Component struct{}

Component struct serves as a virtual resource type for the system component

This struct is auto-generated

func (Component) RbacResource

func (r Component) RbacResource() string

RbacResource returns string representation of RBAC resource for Component by calling ComponentRbacResource fn

RBAC resource is in the corteza::system/... format

This function is auto-generated

type ConfiguredConnection

type ConfiguredConnection struct {
	ID           uint64 `json:"configurationID,string"`
	ConnectionID uint64 `json:"connectionID,string"`

	Name   string `json:"name"`
	Status string `json:"status"`

	Connection Connection                 `json:"connection"`
	Config     ConfiguredConnectionConfig `json:"config"`

	Labels map[string]labelTypes.LabelValue `json:"labels,omitempty"`

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	CreatedBy uint64     `json:"createdBy,string"`
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	UpdatedBy uint64     `json:"updatedBy,string,omitempty"`
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
	DeletedBy uint64     `json:"deletedBy,string,omitempty"`
}

func (ConfiguredConnection) GetID

func (r ConfiguredConnection) GetID() uint64

func (ConfiguredConnection) GetLabels

GetLabels adds new label to label map

func (*ConfiguredConnection) GetValue

func (r *ConfiguredConnection) GetValue(name string, pos uint) (any, error)

func (ConfiguredConnection) LabelResourceID

func (m ConfiguredConnection) LabelResourceID() uint64

GetLabels adds new label to label map

func (ConfiguredConnection) LabelResourceKind

func (ConfiguredConnection) LabelResourceKind() string

GetLabels adds new label to label map

func (ConfiguredConnection) RbacResource

func (r ConfiguredConnection) RbacResource() string

RbacResource returns string representation of RBAC resource for ConfiguredConnection by calling ConfiguredConnectionRbacResource fn

RBAC resource is in the corteza::system:configured-connection/... format

This function is auto-generated

func (*ConfiguredConnection) SetLabel

func (m *ConfiguredConnection) SetLabel(key string, value labelTypes.LabelValue)

SetLabel adds new label to label map

func (*ConfiguredConnection) SetValue

func (r *ConfiguredConnection) SetValue(name string, pos uint, value any) (err error)

type ConfiguredConnectionCheckResult

type ConfiguredConnectionCheckResult struct {
	Connectivity ConfiguredConnectionCheckStatus  `json:"connectivity"`
	Auth         ConfiguredConnectionCheckStatus  `json:"auth"`
	Probe        *ConfiguredConnectionCheckStatus `json:"probe,omitempty"`
}

type ConfiguredConnectionCheckStatus

type ConfiguredConnectionCheckStatus struct {
	OK      bool   `json:"ok"`
	Message string `json:"message,omitempty"`
}

type ConfiguredConnectionConfig

type ConfiguredConnectionConfig struct {
	NamespaceID     uint64 `json:"namespaceID,string"`
	DalConnectionID uint64 `json:"dalConnectionID,string"`

	CredentialID uint64                      `json:"credentialID,string"`
	Params       []ConfiguredConnectionParam `json:"params,omitempty"`

	// Discovery holds cached resource lists fetched at registration time.
	// Keyed by discovery key (e.g. "spreadsheets", "tabs").
	Discovery map[string]json.RawMessage `json:"discovery,omitempty"`
}

func ParseConfiguredConnectionConfig

func ParseConfiguredConnectionConfig(ss []string) (m ConfiguredConnectionConfig, err error)

func (*ConfiguredConnectionConfig) Scan

func (m *ConfiguredConnectionConfig) Scan(src any) error

func (ConfiguredConnectionConfig) Value

type ConfiguredConnectionFilter

type ConfiguredConnectionFilter struct {
	ConnectionID uint64   `json:"connectionID,string"`
	Status       []string `json:"status"`
	Query        string   `json:"query"`

	Deleted filter.State `json:"deleted"`

	LabeledIDs []uint64 `json:"-"`

	Check func(*ConfiguredConnection) (bool, error) `json:"-"`

	filter.Paging
	filter.Sorting
}

type ConfiguredConnectionParam

type ConfiguredConnectionParam struct {
	Scope []string `json:"scope"`
	Name  string   `json:"name"`
	Value string   `json:"value"`
}

type ConfiguredConnectionSet

type ConfiguredConnectionSet []*ConfiguredConnection

ConfiguredConnectionSet slice of ConfiguredConnection

This type is auto-generated.

func (ConfiguredConnectionSet) Filter

Filter iterates through every slice item, calls f(ConfiguredConnection) (bool, err) and return filtered slice

This function is auto-generated.

func (ConfiguredConnectionSet) FindByID

FindByID finds items from slice by its ID property

This function is auto-generated.

func (ConfiguredConnectionSet) IDs

func (set ConfiguredConnectionSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (ConfiguredConnectionSet) Walk

func (set ConfiguredConnectionSet) Walk(w func(*ConfiguredConnection) error) (err error)

Walk iterates through every slice item and calls w(ConfiguredConnection) err

This function is auto-generated.

type Connection

type Connection struct {
	ID       uint64 `json:"connectionID,string"`
	Handle   string `json:"handle"`
	Revision int    `json:"revision"`
	Status   string `json:"status"`

	Meta    ConnectionMeta    `json:"meta"`
	Service ConnectionService `json:"service"`

	Resources     ConnectionResources      `json:"resources"`
	Operations    ConnectionOperations     `json:"operations"`
	DerivedParams []ConnectionDerivedParam `json:"derivedParams,omitempty"`

	Labels map[string]labelTypes.LabelValue `json:"labels,omitempty"`

	Source         string `json:"source,omitempty"`         // "catalog" | "local"
	CatalogID      string `json:"catalogID,omitempty"`      // runtime-only: appstore connection ID, populated during Search
	InstalledCount int    `json:"installedCount,omitempty"` // number of ConfiguredConnections

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	CreatedBy uint64     `json:"createdBy,string"`
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	UpdatedBy uint64     `json:"updatedBy,string,omitempty"`
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
	DeletedBy uint64     `json:"deletedBy,string,omitempty"`
}

func (Connection) GetID

func (r Connection) GetID() uint64

func (Connection) GetLabels

func (m Connection) GetLabels() map[string]labelTypes.LabelValue

GetLabels adds new label to label map

func (*Connection) GetValue

func (r *Connection) GetValue(name string, pos uint) (any, error)

func (Connection) LabelResourceID

func (m Connection) LabelResourceID() uint64

GetLabels adds new label to label map

func (Connection) LabelResourceKind

func (Connection) LabelResourceKind() string

GetLabels adds new label to label map

func (Connection) RbacResource

func (r Connection) RbacResource() string

RbacResource returns string representation of RBAC resource for Connection by calling ConnectionRbacResource fn

RBAC resource is in the corteza::system:connection/... format

This function is auto-generated

func (*Connection) Scan

func (m *Connection) Scan(src any) error

func (*Connection) SetLabel

func (m *Connection) SetLabel(key string, value labelTypes.LabelValue)

SetLabel adds new label to label map

func (*Connection) SetValue

func (r *Connection) SetValue(name string, pos uint, value any) (err error)

func (Connection) Value

func (m Connection) Value() (driver.Value, error)

type ConnectionAuth

type ConnectionAuth struct {
	Method string                        `json:"method"` // none | api_token | basic | oauth2_client_credentials
	Params map[string]ConnectionTemplate `json:"params,omitempty"`
}

type ConnectionDerivedParam

type ConnectionDerivedParam struct {
	Name        string   `json:"name"`
	Label       string   `json:"label"`
	Scope       []string `json:"scope"`
	Type        string   `json:"type"`
	Description string   `json:"description"`
	Required    bool     `json:"required"`
	Default     string   `json:"default"`
	Options     []string `json:"options,omitempty"`
}

type ConnectionFilter

type ConnectionFilter struct {
	Handle string   `json:"handle"`
	Status []string `json:"status"`
	Query  string   `json:"query"`
	Tags   []string `json:"tags"`
	Source string   `json:"source"` // "catalog", "local", or "" for all

	Deleted filter.State `json:"deleted"`

	LabeledIDs []uint64 `json:"-"`

	Check func(*Connection) (bool, error) `json:"-"`

	filter.Paging
	filter.Sorting
}

type ConnectionHTTPAction

type ConnectionHTTPAction struct {
	Method       string                        `json:"method"`
	Path         ConnectionTemplate            `json:"path"`
	Headers      map[string]ConnectionTemplate `json:"headers,omitempty"`
	QueryParams  map[string]ConnectionTemplate `json:"queryParams,omitempty"`
	BodyTemplate ConnectionTemplate            `json:"bodyTemplate,omitempty"`
	ResponseMap  map[string]string             `json:"responseMap,omitempty"`
}

type ConnectionIcon

type ConnectionIcon struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

type ConnectionMeta

type ConnectionMeta struct {
	Short       string   `json:"short"`
	Description string   `json:"description"`
	Icon        string   `json:"icon"`
	Tags        []string `json:"tags"`
}

func ParseConnectionMeta

func ParseConnectionMeta(ss []string) (m ConnectionMeta, err error)

func (*ConnectionMeta) Scan

func (m *ConnectionMeta) Scan(src any) error

func (ConnectionMeta) Value

func (m ConnectionMeta) Value() (driver.Value, error)

type ConnectionMimeBuildAction

type ConnectionMimeBuildAction struct {
	// Template strings referencing input vars via {{varName}}
	To      string `json:"to"`
	Subject string `json:"subject"`
	Body    string `json:"body"`
	From    string `json:"from,omitempty"`
	// Output is the variable name the base64url-encoded raw message is stored under
	Output string `json:"output"`
}

type ConnectionOperation

type ConnectionOperation struct {
	Handle string                           `json:"handle"`
	Meta   ConnectionResourceMeta           `json:"meta"`
	Input  []ConnectionOperationInputField  `json:"input,omitempty"`
	Output []ConnectionOperationOutputField `json:"output,omitempty"`
	Steps  []ConnectionOperationStep        `json:"steps,omitempty"`
}

type ConnectionOperationInputField

type ConnectionOperationInputField struct {
	Name      string         `json:"name"`
	Type      string         `json:"type"`
	Required  bool           `json:"required,omitempty"`
	Aggregate bool           `json:"aggregate,omitempty"`
	Meta      map[string]any `json:"meta,omitempty"`
}

type ConnectionOperationOutputField

type ConnectionOperationOutputField struct {
	Name     string         `json:"name"`
	Type     string         `json:"type"`
	Selector []string       `json:"selector,omitempty"`
	Meta     map[string]any `json:"meta,omitempty"`
}

type ConnectionOperationStep

type ConnectionOperationStep struct {
	Type      string                     `json:"type"` // http | mime_build
	HTTP      *ConnectionHTTPAction      `json:"http,omitempty"`
	MimeBuild *ConnectionMimeBuildAction `json:"mime_build,omitempty"`
}

type ConnectionOperations

type ConnectionOperations []ConnectionOperation

func (*ConnectionOperations) Scan

func (m *ConnectionOperations) Scan(src any) error

func (ConnectionOperations) Value

func (m ConnectionOperations) Value() (driver.Value, error)

type ConnectionPlaceholder

type ConnectionPlaceholder struct {
	Name        string   `json:"name"`
	Label       string   `json:"label,omitempty"`
	Type        string   `json:"type"`
	Description string   `json:"description"`
	Required    bool     `json:"required"`
	Default     string   `json:"default"`
	Options     []string `json:"options,omitempty"`
}

type ConnectionProbe

type ConnectionProbe struct {
	Path ConnectionTemplate `json:"path"`
	// Default expected status is 200
	ExpectedStatus int `json:"expectedStatus,omitempty"`
}

type ConnectionResource

type ConnectionResource struct {
	Handle     string                       `json:"handle"`
	Meta       ConnectionResourceMeta       `json:"meta"`
	Endpoint   ConnectionTemplate           `json:"endpoint"`
	Operations ConnectionResourceOperations `json:"operations,omitempty"`
	Fields     []ConnectionResourceField    `json:"fields"`
	Webhooks   []ConnectionWebhook          `json:"webhooks,omitempty"`
}

type ConnectionResourceField

type ConnectionResourceField struct {
	Name     string         `json:"name"`
	Type     string         `json:"type"`
	Selector []string       `json:"selector,omitempty"`
	Meta     map[string]any `json:"meta,omitempty"`
}

type ConnectionResourceMeta

type ConnectionResourceMeta struct {
	Short       string          `json:"short"`
	Description string          `json:"description"`
	Icon        *ConnectionIcon `json:"icon,omitempty"`
}

type ConnectionResourceOperations

type ConnectionResourceOperations struct {
	List   *ConnectionHTTPAction `json:"list,omitempty"`
	Read   *ConnectionHTTPAction `json:"read,omitempty"`
	Create *ConnectionHTTPAction `json:"create,omitempty"`
	Update *ConnectionHTTPAction `json:"update,omitempty"`
	Delete *ConnectionHTTPAction `json:"delete,omitempty"`
}

func (*ConnectionResourceOperations) Scan

func (m *ConnectionResourceOperations) Scan(src any) error

func (ConnectionResourceOperations) Value

type ConnectionResources

type ConnectionResources []ConnectionResource

Slice types for DB JSON serialization

func (*ConnectionResources) Scan

func (m *ConnectionResources) Scan(src any) error

func (ConnectionResources) Value

func (m ConnectionResources) Value() (driver.Value, error)

type ConnectionService

type ConnectionService struct {
	BaseURL     ConnectionTemplate            `json:"baseURL"`
	Protocol    string                        `json:"protocol"`
	ContentType string                        `json:"contentType"`
	Headers     map[string]ConnectionTemplate `json:"headers,omitempty"`
	Auth        ConnectionAuth                `json:"auth"`
	Probe       *ConnectionProbe              `json:"probe,omitempty"`
	// Params are plain connection-level inputs (e.g. impersonation subject)
	// that are collected from the user at configuration time, stored in cc.Config.Params,
	// and available for template substitution under the "service" scope.
	Params []ConnectionPlaceholder `json:"params,omitempty"`
}

func ParseConnectionService

func ParseConnectionService(ss []string) (m ConnectionService, err error)

func (*ConnectionService) Scan

func (m *ConnectionService) Scan(src any) error

func (ConnectionService) Value

func (m ConnectionService) Value() (driver.Value, error)

type ConnectionSet

type ConnectionSet []*Connection

ConnectionSet slice of Connection

This type is auto-generated.

func (ConnectionSet) Filter

func (set ConnectionSet) Filter(f func(*Connection) (bool, error)) (out ConnectionSet, err error)

Filter iterates through every slice item, calls f(Connection) (bool, err) and return filtered slice

This function is auto-generated.

func (ConnectionSet) FindByID

func (set ConnectionSet) FindByID(ID uint64) *Connection

FindByID finds items from slice by its ID property

This function is auto-generated.

func (ConnectionSet) IDs

func (set ConnectionSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (ConnectionSet) Walk

func (set ConnectionSet) Walk(w func(*Connection) error) (err error)

Walk iterates through every slice item and calls w(Connection) err

This function is auto-generated.

type ConnectionTemplate

type ConnectionTemplate struct {
	Value        string                  `json:"value"`
	Placeholders []ConnectionPlaceholder `json:"placeholders,omitempty"`
}

func (*ConnectionTemplate) UnmarshalJSON

func (ct *ConnectionTemplate) UnmarshalJSON(data []byte) error

type ConnectionWebhook

type ConnectionWebhook struct {
	Event   string                   `json:"event"`
	Path    string                   `json:"path"`
	Payload []ConnectionWebhookField `json:"payload,omitempty"`
	Mapping map[string]string        `json:"mapping,omitempty"`
}

type ConnectionWebhookField

type ConnectionWebhookField struct {
	Name     string         `json:"name"`
	Type     string         `json:"type"`
	Selector []string       `json:"selector,omitempty"`
	Meta     map[string]any `json:"meta,omitempty"`
}

type Credential

type Credential struct {
	ID          uint64         `json:"credentialsID,string"`
	OwnerID     uint64         `json:"ownerID,string"`
	Label       string         `json:"label"`
	Kind        string         `json:"kind"`
	Credentials string         `json:"-"`
	Meta        types.JSONText `json:"-"`
	LastUsedAt  *time.Time     `json:"lastUsedAt,omitempty"`
	ExpiresAt   *time.Time     `json:"expiresAt,omitempty"`
	CreatedAt   time.Time      `json:"createdAt,omitempty"`
	UpdatedAt   *time.Time     `json:"updatedAt,omitempty"`
	DeletedAt   *time.Time     `json:"deletedAt,omitempty"`
}

func (*Credential) Valid

func (u *Credential) Valid() bool

type CredentialFilter

type CredentialFilter struct {
	OwnerID     uint64       `json:"ownerID"`
	Kind        string       `json:"kind"`
	Credentials string       `json:"credentials"`
	Deleted     filter.State `json:"deleted"`
	Limit       uint
}

type CredentialSet

type CredentialSet []*Credential

CredentialSet slice of Credential

This type is auto-generated.

func (CredentialSet) Filter

func (set CredentialSet) Filter(f func(*Credential) (bool, error)) (out CredentialSet, err error)

Filter iterates through every slice item, calls f(Credential) (bool, err) and return filtered slice

This function is auto-generated.

func (CredentialSet) FindByID

func (set CredentialSet) FindByID(ID uint64) *Credential

FindByID finds items from slice by its ID property

This function is auto-generated.

func (CredentialSet) IDs

func (set CredentialSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (CredentialSet) Walk

func (set CredentialSet) Walk(w func(*Credential) error) (err error)

Walk iterates through every slice item and calls w(Credential) err

This function is auto-generated.

type DalConnection

type DalConnection struct {
	ID     uint64 `json:"connectionID,string"`
	Handle string `json:"handle"`
	Type   string `json:"type"`

	// descriptions, notes, and other user-provided meta-data
	Meta DalConnectionMeta `json:"meta"`

	// collection of configurations for various subsystems that
	// use this connection and how it affects their behaviour
	Config DalConnectionConfig `json:"config"`

	Issues []dal.Issue `json:"issues,omitempty"`

	Labels map[string]string `json:"labels,omitempty"`

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	CreatedBy uint64     `json:"createdBy,string" `
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	UpdatedBy uint64     `json:"updatedBy,string,omitempty"`
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
	DeletedBy uint64     `json:"deletedBy,string,omitempty"`
}

func (DalConnection) GetID

func (r DalConnection) GetID() uint64

func (*DalConnection) GetValue

func (r *DalConnection) GetValue(name string, pos uint) (any, error)

func (DalConnection) HasIssues

func (c DalConnection) HasIssues() bool

func (DalConnection) RbacResource

func (r DalConnection) RbacResource() string

RbacResource returns string representation of RBAC resource for DalConnection by calling DalConnectionRbacResource fn

RBAC resource is in the corteza::system:dal-connection/... format

This function is auto-generated

func (*DalConnection) SetValue

func (r *DalConnection) SetValue(name string, pos uint, value any) (err error)

type DalConnectionConfig

type DalConnectionConfig struct {
	// DAL configuration
	// using ptr to allow nil values (when dealing with access-controlled data)
	DAL *DalConnectionConfigDAL `json:"dal,omitempty"`

	// Privacy configuration
	Privacy DalConnectionConfigPrivacy `json:"privacy"`
}

func ParseDalConnectionConfig

func ParseDalConnectionConfig(ss []string) (m DalConnectionConfig, err error)

func (*DalConnectionConfig) Scan

func (nm *DalConnectionConfig) Scan(src any) error

func (DalConnectionConfig) Value

func (nm DalConnectionConfig) Value() (driver.Value, error)

type DalConnectionConfigDAL

type DalConnectionConfigDAL struct {
	// type of connection
	Type string `json:"type"`

	// parameters for the connection
	Params map[string]any `json:"params"`

	// ident to be used when generating models from modules using this connection
	// it can use {{module}} and {{namespace}} as placeholders
	ModelIdent string `json:"modelIdent"`

	// set of regular-expression strings that will be used to match against
	// generated model identifiers
	ModelIdentCheck []string `json:"modelIdentCheck"`
}

DalConnectionConfigDAL a set of connection parameters and model configuration

type DalConnectionConfigPrivacy

type DalConnectionConfigPrivacy struct {
	// Sets max-allowed data-sensitivity level for this connection
	//
	// Fields of the modules using this connection should have equal or
	// lower sensitivity level
	SensitivityLevelID uint64 `json:"sensitivityLevelID,string,omitempty"`
}

type DalConnectionFilter

type DalConnectionFilter struct {
	DalConnectionID []string `json:"connectionID"`
	Handle          string   `json:"handle"`
	Type            string   `json:"type"`

	Deleted filter.State `json:"deleted"`

	// Check fn is called by store backend for each resource found function can
	// modify the resource and return false if store should not return it
	//
	// Store then loads additional resources to satisfy the paging parameters
	Check func(*DalConnection) (bool, error) `json:"-"`

	// Standard helpers for paging and sorting
	filter.Paging
	filter.Sorting
}

type DalConnectionMeta

type DalConnectionMeta struct {
	Name       string                      `json:"name"`
	Ownership  string                      `json:"ownership"`
	Location   geolocation.Full            `json:"location"`
	Properties DalConnectionMetaProperties `json:"properties"`
}

func ParseDalConnectionMeta

func ParseDalConnectionMeta(ss []string) (m DalConnectionMeta, err error)

func (*DalConnectionMeta) Scan

func (nm *DalConnectionMeta) Scan(src any) error

func (DalConnectionMeta) Value

func (nm DalConnectionMeta) Value() (driver.Value, error)

type DalConnectionMetaProperties

type DalConnectionMetaProperties struct {
	DataAtRestEncryption    DalConnectionMetaProperty `json:"dataAtRestEncryption"`
	DataAtRestProtection    DalConnectionMetaProperty `json:"dataAtRestProtection"`
	DataAtTransitEncryption DalConnectionMetaProperty `json:"dataAtTransitEncryption"`
	DataRestoration         DalConnectionMetaProperty `json:"dataRestoration"`
}

type DalConnectionMetaProperty

type DalConnectionMetaProperty struct {
	Enabled bool   `json:"enabled"`
	Notes   string `json:"notes"`
}

type DalConnectionSet

type DalConnectionSet []*DalConnection

DalConnectionSet slice of DalConnection

This type is auto-generated.

func (DalConnectionSet) Filter

func (set DalConnectionSet) Filter(f func(*DalConnection) (bool, error)) (out DalConnectionSet, err error)

Filter iterates through every slice item, calls f(DalConnection) (bool, err) and return filtered slice

This function is auto-generated.

func (DalConnectionSet) FindByID

func (set DalConnectionSet) FindByID(ID uint64) *DalConnection

FindByID finds items from slice by its ID property

This function is auto-generated.

func (DalConnectionSet) IDs

func (set DalConnectionSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (DalConnectionSet) Walk

func (set DalConnectionSet) Walk(w func(*DalConnection) error) (err error)

Walk iterates through every slice item and calls w(DalConnection) err

This function is auto-generated.

type DalSchemaAlteration

type DalSchemaAlteration struct {
	ID           uint64 `json:"alterationID,string"`
	BatchID      uint64 `json:"batchID,string"`
	DependsOn    uint64 `json:"dependsOn,string,omitempty"`
	ConnectionID uint64 `json:"connectionID,string"`
	Resource     string `json:"resource"`
	ResourceType string `json:"resourceType"`

	Kind   string                     `json:"kind"`
	Params *DalSchemaAlterationParams `json:"params"`

	Error string `json:"error,omitempty"`

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	CreatedBy uint64     `json:"createdBy,string" `
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	UpdatedBy uint64     `json:"updatedBy,string,omitempty"`
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
	DeletedBy uint64     `json:"deletedBy,string,omitempty"`

	CompletedAt *time.Time `json:"completedAt,omitempty"`
	CompletedBy uint64     `json:"completedBy,string,omitempty"`
	DismissedAt *time.Time `json:"dismissedAt,omitempty"`
	DismissedBy uint64     `json:"dismissedBy,string,omitempty"`
}

func (DalSchemaAlteration) GetID

func (r DalSchemaAlteration) GetID() uint64

func (*DalSchemaAlteration) GetValue

func (r *DalSchemaAlteration) GetValue(name string, pos uint) (any, error)

func (*DalSchemaAlteration) SetValue

func (r *DalSchemaAlteration) SetValue(name string, pos uint, value any) (err error)

type DalSchemaAlterationFilter

type DalSchemaAlterationFilter struct {
	AlterationID []string `json:"alterationID"`
	BatchID      []uint64 `json:"batchID,string"`
	Kind         string   `json:"kind"`
	Resource     []string `json:"resource"`
	ResourceType string   `json:"resourceType"`

	Deleted   filter.State `json:"deleted"`
	Completed filter.State `json:"completed"`
	Dismissed filter.State `json:"dismissed"`

	// Standard helpers for paging and sorting
	filter.Sorting
	filter.Paging
}

type DalSchemaAlterationParams

type DalSchemaAlterationParams struct {
	AttributeAdd      *dal.AttributeAdd      `json:"attributeAdd,omitempty"`
	AttributeDelete   *dal.AttributeDelete   `json:"attributeDelete,omitempty"`
	AttributeReType   *dal.AttributeReType   `json:"attributeReType,omitempty"`
	AttributeReEncode *dal.AttributeReEncode `json:"attributeReEncode,omitempty"`
	ModelAdd          *dal.ModelAdd          `json:"modelAdd,omitempty"`
	ModelDelete       *dal.ModelDelete       `json:"modelDelete,omitempty"`
}

func (*DalSchemaAlterationParams) Scan

func (meta *DalSchemaAlterationParams) Scan(src any) error

func (*DalSchemaAlterationParams) Value

func (meta *DalSchemaAlterationParams) Value() (driver.Value, error)

type DalSchemaAlterationSet

type DalSchemaAlterationSet []*DalSchemaAlteration

DalSchemaAlterationSet slice of DalSchemaAlteration

This type is auto-generated.

func (DalSchemaAlterationSet) Filter

Filter iterates through every slice item, calls f(DalSchemaAlteration) (bool, err) and return filtered slice

This function is auto-generated.

func (DalSchemaAlterationSet) FindByID

FindByID finds items from slice by its ID property

This function is auto-generated.

func (DalSchemaAlterationSet) IDs

func (set DalSchemaAlterationSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (DalSchemaAlterationSet) Walk

func (set DalSchemaAlterationSet) Walk(w func(*DalSchemaAlteration) error) (err error)

Walk iterates through every slice item and calls w(DalSchemaAlteration) err

This function is auto-generated.

type DalSensitivityLevel

type DalSensitivityLevel struct {
	ID     uint64 `json:"sensitivityLevelID,string"`
	Handle string `json:"handle"`
	Level  int    `json:"level"`

	Meta DalSensitivityLevelMeta `json:"meta"`

	Labels map[string]string `json:"labels,omitempty"`

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	CreatedBy uint64     `json:"createdBy,string" `
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	UpdatedBy uint64     `json:"updatedBy,string,omitempty" `
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
	DeletedBy uint64     `json:"deletedBy,string,omitempty" `
}

func (DalSensitivityLevel) GetID

func (r DalSensitivityLevel) GetID() uint64

func (*DalSensitivityLevel) GetValue

func (r *DalSensitivityLevel) GetValue(name string, pos uint) (any, error)

func (*DalSensitivityLevel) SetValue

func (r *DalSensitivityLevel) SetValue(name string, pos uint, value any) (err error)

type DalSensitivityLevelFilter

type DalSensitivityLevelFilter struct {
	DalSensitivityLevelID []string `json:"sensitivityLevelID"`
	Handle                string   `json:"handle"`

	Deleted filter.State `json:"deleted"`

	// Check fn is called by store backend for each resource found function can
	// modify the resource and return false if store should not return it
	//
	// Store then loads additional resources to satisfy the paging parameters
	Check func(*DalSensitivityLevel) (bool, error) `json:"-"`

	// Standard helpers for paging and sorting
	filter.Paging
	filter.Sorting
}

type DalSensitivityLevelMeta

type DalSensitivityLevelMeta struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

func ParseDalSensitivityLevelMeta

func ParseDalSensitivityLevelMeta(ss []string) (m DalSensitivityLevelMeta, err error)

func (*DalSensitivityLevelMeta) Scan

func (nm *DalSensitivityLevelMeta) Scan(src any) error

func (DalSensitivityLevelMeta) Value

func (nm DalSensitivityLevelMeta) Value() (driver.Value, error)

type DalSensitivityLevelSet

type DalSensitivityLevelSet []*DalSensitivityLevel

DalSensitivityLevelSet slice of DalSensitivityLevel

This type is auto-generated.

func (DalSensitivityLevelSet) Filter

Filter iterates through every slice item, calls f(DalSensitivityLevel) (bool, err) and return filtered slice

This function is auto-generated.

func (DalSensitivityLevelSet) FindByID

FindByID finds items from slice by its ID property

This function is auto-generated.

func (DalSensitivityLevelSet) IDs

func (set DalSensitivityLevelSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (DalSensitivityLevelSet) Len

func (ss DalSensitivityLevelSet) Len() int

func (DalSensitivityLevelSet) Less

func (ss DalSensitivityLevelSet) Less(i, j int) bool

func (DalSensitivityLevelSet) Swap

func (ss DalSensitivityLevelSet) Swap(i, j int)

func (DalSensitivityLevelSet) Walk

func (set DalSensitivityLevelSet) Walk(w func(*DalSensitivityLevel) error) (err error)

Walk iterates through every slice item and calls w(DalSensitivityLevel) err

This function is auto-generated.

type DataPrivacyRequest

type DataPrivacyRequest struct {
	ID uint64 `json:"requestID,string"`

	Kind   RequestKind   `json:"kind"`
	Status RequestStatus `json:"status"`

	Payload DataPrivacyRequestPayloadSet `json:"payload,omitempty"`

	RequestedAt time.Time  `json:"requestedAt,omitempty"`
	RequestedBy uint64     `json:"requestedBy,string"`
	CompletedAt *time.Time `json:"completedAt,omitempty"`
	CompletedBy uint64     `json:"completedBy,string,omitempty" `

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	CreatedBy uint64     `json:"createdBy,string" `
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	UpdatedBy uint64     `json:"updatedBy,string,omitempty"`
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
	DeletedBy uint64     `json:"deletedBy,string,omitempty"`
}

func (DataPrivacyRequest) RbacResource

func (r DataPrivacyRequest) RbacResource() string

RbacResource returns string representation of RBAC resource for DataPrivacyRequest by calling DataPrivacyRequestRbacResource fn

RBAC resource is in the corteza::system:data-privacy-request/... format

This function is auto-generated

type DataPrivacyRequestComment

type DataPrivacyRequestComment struct {
	ID        uint64 `json:"commentID,string"`
	RequestID uint64 `json:"requestID,string"`
	Comment   string `json:"comment"`

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	CreatedBy uint64     `json:"createdBy,string" `
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	UpdatedBy uint64     `json:"updatedBy,string,omitempty"`
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
	DeletedBy uint64     `json:"deletedBy,string,omitempty"`
}

func (DataPrivacyRequestComment) GetID

func (*DataPrivacyRequestComment) GetValue

func (r *DataPrivacyRequestComment) GetValue(name string, pos uint) (any, error)

func (*DataPrivacyRequestComment) SetValue

func (r *DataPrivacyRequestComment) SetValue(name string, pos uint, value any) (err error)

type DataPrivacyRequestCommentFilter

type DataPrivacyRequestCommentFilter struct {
	RequestID []string `json:"requestID"`

	// Check fn is called by store backend for each resource found function can
	// modify the resource and return false if store should not return it
	//
	// Store then loads additional resources to satisfy the paging parameters
	Check func(request *DataPrivacyRequestComment) (bool, error) `json:"-"`

	// Standard helpers for paging and sorting
	filter.Sorting
	filter.Paging
}

type DataPrivacyRequestCommentSet

type DataPrivacyRequestCommentSet []*DataPrivacyRequestComment

DataPrivacyRequestCommentSet slice of DataPrivacyRequestComment

This type is auto-generated.

func (DataPrivacyRequestCommentSet) Filter

Filter iterates through every slice item, calls f(DataPrivacyRequestComment) (bool, err) and return filtered slice

This function is auto-generated.

func (DataPrivacyRequestCommentSet) FindByID

FindByID finds items from slice by its ID property

This function is auto-generated.

func (DataPrivacyRequestCommentSet) IDs

func (set DataPrivacyRequestCommentSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (DataPrivacyRequestCommentSet) Walk

Walk iterates through every slice item and calls w(DataPrivacyRequestComment) err

This function is auto-generated.

type DataPrivacyRequestFilter

type DataPrivacyRequestFilter struct {
	RequestID   []string `json:"requestID"`
	RequestedBy []string `json:"requestedBy"`

	Query string `json:"query"`

	Kind   []string `json:"kind"`
	Status []string `json:"status"`

	// Check fn is called by store backend for each resource found function can
	// modify the resource and return false if store should not return it
	//
	// Store then loads additional resources to satisfy the paging parameters
	Check func(request *DataPrivacyRequest) (bool, error) `json:"-"`

	// Standard helpers for paging and sorting
	filter.Sorting
	filter.Paging
}

type DataPrivacyRequestPayload

type DataPrivacyRequestPayload struct {
	ConnectionID uint64                     `json:"connectionID,string"`
	NamespaceID  uint64                     `json:"namespaceID,string"`
	ModuleID     uint64                     `json:"moduleID,string"`
	Records      []DataPrivacyRequestRecord `json:"records"`
}

DataPrivacyRequestPayloadSet []DataPrivacyRequestPayload

type DataPrivacyRequestPayloadSet

type DataPrivacyRequestPayloadSet []map[string]any

@todo temporarily using this; revert to proper struct after dev release

func ParseDataPrivacyRequestPayload

func ParseDataPrivacyRequestPayload(ii []string) (out DataPrivacyRequestPayloadSet, err error)

func (*DataPrivacyRequestPayloadSet) Scan

func (bb *DataPrivacyRequestPayloadSet) Scan(src any) error

func (DataPrivacyRequestPayloadSet) Value

type DataPrivacyRequestRecord

type DataPrivacyRequestRecord struct {
	RecordID uint64                          `json:"recordID,string"`
	Values   []DataPrivacyRequestRecordValue `json:"values"`
}

type DataPrivacyRequestRecordValue

type DataPrivacyRequestRecordValue struct {
	Name     string `json:"name"`
	Value    string `json:"value"`
	Position int    `json:"position"`
}

type DataPrivacyRequestSet

type DataPrivacyRequestSet []*DataPrivacyRequest

DataPrivacyRequestSet slice of DataPrivacyRequest

This type is auto-generated.

func (DataPrivacyRequestSet) Filter

Filter iterates through every slice item, calls f(DataPrivacyRequest) (bool, err) and return filtered slice

This function is auto-generated.

func (DataPrivacyRequestSet) FindByID

FindByID finds items from slice by its ID property

This function is auto-generated.

func (DataPrivacyRequestSet) IDs

func (set DataPrivacyRequestSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (DataPrivacyRequestSet) Walk

func (set DataPrivacyRequestSet) Walk(w func(*DataPrivacyRequest) error) (err error)

Walk iterates through every slice item and calls w(DataPrivacyRequest) err

This function is auto-generated.

type DocumentType

type DocumentType string
const (
	DocumentTypePlain DocumentType = "text/plain"
	DocumentTypeHTML  DocumentType = "text/html"
	DocumentTypePDF   DocumentType = "application/pdf"
)

type ExternalAuthProvider

type ExternalAuthProvider struct {
	Enabled     bool   `json:"enabled"`
	Handle      string `json:"handle"`
	Label       string `json:"label"`
	Key         string `json:"-"`
	Secret      string `json:"-"`
	Scope       string `json:"scope"`
	RedirectUrl string `json:"-" kv:"redirect"`
	IssuerUrl   string `json:"-" kv:"issuer"`
	Weight      int    `json:"-"`

	// potentially just use home-brew scopes?
	Usage []string `json:"usage" kv:"usage"`

	Security ExternalAuthProviderSecurity `json:"-" kv:"security,final"`
}

func (ExternalAuthProvider) EncodeKV

func (eap ExternalAuthProvider) EncodeKV() (vv SettingValueSet, err error)

func (*ExternalAuthProvider) ValidConfiguration

func (set *ExternalAuthProvider) ValidConfiguration() bool

type ExternalAuthProviderSecurity

type ExternalAuthProviderSecurity struct {
	// Subset of roles, permitted to be used with this client
	// when authorizing via this auth provider.
	//
	// IDs are intentionally stored as strings to support JS (int64 only)
	//
	PermittedRoles []string `json:"permittedRoles,omitempty"`

	// Subset of roles, prohibited to be used with this client
	// when authorizing via this auth provider.
	//
	// IDs are intentionally stored as strings to support JS (int64 only)
	//
	ProhibitedRoles []string `json:"prohibitedRoles,omitempty"`

	// Set of additional roles that are forced on this user
	// when authorizing via this auth provider.
	//
	// IDs are intentionally stored as strings to support JS (int64 only)
	ForcedRoles []string `json:"forcedRoles,omitempty"`
}

type ExternalAuthProviderSet

type ExternalAuthProviderSet []*ExternalAuthProvider

func (*ExternalAuthProviderSet) DecodeKV

func (set *ExternalAuthProviderSet) DecodeKV(kv SettingsKV, prefix string) (err error)

DecodeKV translates settings' KV into internal system external auth settings

func (ExternalAuthProviderSet) FindByHandle

func (set ExternalAuthProviderSet) FindByHandle(handle string) *ExternalAuthProvider

func (ExternalAuthProviderSet) Len

func (set ExternalAuthProviderSet) Len() int

func (ExternalAuthProviderSet) Less

func (set ExternalAuthProviderSet) Less(i, j int) bool

func (ExternalAuthProviderSet) Swap

func (set ExternalAuthProviderSet) Swap(i, j int)

func (ExternalAuthProviderSet) Valid

Returns enabled providers, sorted with their redirect-URLs set...

type ExternalAuthUser

type ExternalAuthUser struct {
	goth.User
}

type KVDecoder

type KVDecoder interface {
	DecodeKV(SettingsKV, string) error
}

KVDecoder interface for custom decoding logic

type KnowledgeBase

type KnowledgeBase struct {
	ID     uint64 `json:"knowledgeBaseID,string"`
	Handle string `json:"handle"`

	Title       string `json:"title"`
	Description string `json:"description,omitempty"`

	Context *KnowledgeBaseContext `json:"context,omitempty"`

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	CreatedBy uint64     `json:"createdBy,string"`
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	UpdatedBy uint64     `json:"updatedBy,string,omitempty"`
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
	DeletedBy uint64     `json:"deletedBy,string,omitempty"`
}

func (KnowledgeBase) GetID

func (r KnowledgeBase) GetID() uint64

func (*KnowledgeBase) GetValue

func (r *KnowledgeBase) GetValue(name string, pos uint) (any, error)

func (KnowledgeBase) RbacResource

func (r KnowledgeBase) RbacResource() string

RbacResource returns string representation of RBAC resource for KnowledgeBase by calling KnowledgeBaseRbacResource fn

RBAC resource is in the corteza::system:knowledge-base/... format

This function is auto-generated

func (*KnowledgeBase) SetValue

func (r *KnowledgeBase) SetValue(name string, pos uint, value any) (err error)

type KnowledgeBaseContext

type KnowledgeBaseContext struct {
	Namespaces []KnowledgeBaseNamespaceContext `json:"namespaces"`
}

func ParseKnowledgeBaseContext

func ParseKnowledgeBaseContext(ss []string) (p KnowledgeBaseContext, err error)

func (*KnowledgeBaseContext) Scan

func (m *KnowledgeBaseContext) Scan(src any) error

func (KnowledgeBaseContext) Value

func (m KnowledgeBaseContext) Value() (driver.Value, error)

type KnowledgeBaseFilter

type KnowledgeBaseFilter struct {
	KnowledgeBaseID []uint64     `json:"knowledgeBaseID"`
	Handle          string       `json:"handle"`
	Query           string       `json:"query"`
	Deleted         filter.State `json:"deleted"`

	Check func(*KnowledgeBase) (bool, error) `json:"-"`

	filter.Sorting
	filter.Paging
}

type KnowledgeBaseIDList

type KnowledgeBaseIDList []uint64

KnowledgeBaseIDList is a []uint64 that serializes each element as a JSON string.

func (KnowledgeBaseIDList) MarshalJSON

func (ll KnowledgeBaseIDList) MarshalJSON() ([]byte, error)

func (*KnowledgeBaseIDList) UnmarshalJSON

func (ll *KnowledgeBaseIDList) UnmarshalJSON(data []byte) error

type KnowledgeBaseNamespaceContext

type KnowledgeBaseNamespaceContext struct {
	NamespaceID uint64              `json:"namespaceID,string"`
	ModuleIDs   KnowledgeBaseIDList `json:"moduleIDs"`
}

type KnowledgeBaseSet

type KnowledgeBaseSet []*KnowledgeBase

KnowledgeBaseSet slice of KnowledgeBase

This type is auto-generated.

func (KnowledgeBaseSet) Filter

func (set KnowledgeBaseSet) Filter(f func(*KnowledgeBase) (bool, error)) (out KnowledgeBaseSet, err error)

Filter iterates through every slice item, calls f(KnowledgeBase) (bool, err) and return filtered slice

This function is auto-generated.

func (KnowledgeBaseSet) FindByID

func (set KnowledgeBaseSet) FindByID(ID uint64) *KnowledgeBase

FindByID finds items from slice by its ID property

This function is auto-generated.

func (KnowledgeBaseSet) IDs

func (set KnowledgeBaseSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (KnowledgeBaseSet) Walk

func (set KnowledgeBaseSet) Walk(w func(*KnowledgeBase) error) (err error)

Walk iterates through every slice item and calls w(KnowledgeBase) err

This function is auto-generated.

type LLMProviderConfig

type LLMProviderConfig struct {
	PromptURL   string                  `json:"promptURL"`
	Model       string                  `json:"model"`
	Temperature *float64                `json:"temperature,omitempty"`
	Timeout     string                  `json:"timeout"`
	Guard       *LLMProviderGuardConfig `json:"guard,omitempty"`
}

func ParseLLMProviderConfig

func ParseLLMProviderConfig(ss []string) (m LLMProviderConfig, err error)

func (*LLMProviderConfig) Scan

func (nm *LLMProviderConfig) Scan(src any) error

func (LLMProviderConfig) Value

func (nm LLMProviderConfig) Value() (driver.Value, error)

type LLMProviderGuardConfig

type LLMProviderGuardConfig struct {
	Enabled    bool               `json:"enabled"`
	Provider   string             `json:"provider"` // "llama-guard"
	Model      string             `json:"model"`    // "llama-guard3:8b"
	Thresholds map[string]float64 `json:"thresholds,omitempty"`
}

type LLMProviderMeta

type LLMProviderMeta struct {
	Short       string `json:"short"`
	Description string `json:"description"`
}

func ParseLLMProviderMeta

func ParseLLMProviderMeta(ss []string) (m LLMProviderMeta, err error)

func (*LLMProviderMeta) Scan

func (nm *LLMProviderMeta) Scan(src any) error

func (LLMProviderMeta) Value

func (nm LLMProviderMeta) Value() (driver.Value, error)

type Lang

type Lang struct {
	language.Tag
}

func (*Lang) Scan

func (l *Lang) Scan(value any) error

func (Lang) Value

func (l Lang) Value() (driver.Value, error)

Value scan on ReportDataSourceSet gracefully handles conversion from NULL

type LlmProvider

type LlmProvider struct {
	ID           uint64 `json:"llmProviderID,string"`
	Handle       string `json:"handle"`
	Status       string `json:"status"`
	Provider     string `json:"provider"`
	CredentialID uint64 `json:"credentialID,string"`

	Meta   LLMProviderMeta   `json:"meta"`
	Config LLMProviderConfig `json:"config"`

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
	CreatedBy uint64     `json:"createdBy,string"`
	UpdatedBy uint64     `json:"updatedBy,string,omitempty"`
	DeletedBy uint64     `json:"deletedBy,string,omitempty"`
}

func (LlmProvider) GetID

func (r LlmProvider) GetID() uint64

func (*LlmProvider) GetValue

func (r *LlmProvider) GetValue(name string, pos uint) (any, error)

func (LlmProvider) RbacResource

func (r LlmProvider) RbacResource() string

RbacResource returns string representation of RBAC resource for LlmProvider by calling LlmProviderRbacResource fn

RBAC resource is in the corteza::system:llm-provider/... format

This function is auto-generated

func (*LlmProvider) SetValue

func (r *LlmProvider) SetValue(name string, pos uint, value any) (err error)

type LlmProviderFilter

type LlmProviderFilter struct {
	LlmProviderID []uint64     `json:"llmProviderID"`
	Handle        string       `json:"handle"`
	Status        string       `json:"status"`
	Provider      string       `json:"provider"`
	Deleted       filter.State `json:"deleted"`

	Check func(*LlmProvider) (bool, error) `json:"-"`

	filter.Paging
	filter.Sorting
}

type LlmProviderSet

type LlmProviderSet []*LlmProvider

LlmProviderSet slice of LlmProvider

This type is auto-generated.

func (LlmProviderSet) Filter

func (set LlmProviderSet) Filter(f func(*LlmProvider) (bool, error)) (out LlmProviderSet, err error)

Filter iterates through every slice item, calls f(LlmProvider) (bool, err) and return filtered slice

This function is auto-generated.

func (LlmProviderSet) FindByID

func (set LlmProviderSet) FindByID(ID uint64) *LlmProvider

FindByID finds items from slice by its ID property

This function is auto-generated.

func (LlmProviderSet) IDs

func (set LlmProviderSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (LlmProviderSet) Walk

func (set LlmProviderSet) Walk(w func(*LlmProvider) error) (err error)

Walk iterates through every slice item and calls w(LlmProvider) err

This function is auto-generated.

type MailMessage

type MailMessage struct {
	Date time.Time `json:"date"`

	Subject string `json:"subject"`

	Header MailMessageHeader `json:"header"`

	// RawBody will be base64 encoded!
	// (might contain binary data)
	RawBody []byte `json:"rawBody,string"`
}

func NewMailMessage

func NewMailMessage(r io.Reader) (out *MailMessage, err error)

type MailMessageHeader

type MailMessageHeader struct {
	// extract common addresses
	To      []*mail.Address `json:"to"`
	CC      []*mail.Address `json:"cc"`
	BCC     []*mail.Address `json:"bcc"`
	From    []*mail.Address `json:"from"`
	ReplyTo []*mail.Address `json:"replyTo"`

	Raw mail.Header `json:"raw"`
}

type Notification

type Notification struct {
	ID uint64 `json:"notificationID,string"`

	Kind   NotificationKind   `json:"kind"`
	Config NotificationConfig `json:"config"`

	Recipient uint64    `json:"recipient,string"`
	CreatedBy uint64    `json:"createdBy,string"`
	CreatedAt time.Time `json:"createdAt,omitempty"`

	ReadAt    *time.Time `json:"readAt"`
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
}

type NotificationConfig

type NotificationConfig struct {
	Simple SimpleNotificationConfig `json:"simple"`
	Record RecordNotificationConfig `json:"record"`
}

NotificationConfig is a flexible configuration container for notification data

func (*NotificationConfig) Scan

func (nc *NotificationConfig) Scan(src interface{}) error

Scan implements the sql.Scanner interface

func (NotificationConfig) Value

func (nc NotificationConfig) Value() (driver.Value, error)

Value implements the driver.Valuer interface

type NotificationFilter

type NotificationFilter struct {
	NotificationID []uint64           `json:"notificationID"`
	Kind           []NotificationKind `json:"kind"`
	Recipient      uint64             `json:"recipient,string"`
	Read           filter.State       `json:"read"`
	Deleted        filter.State       `json:"deleted"`

	Check func(*Notification) (bool, error) `json:"-"`

	filter.Sorting
	filter.Paging
}

type NotificationKind

type NotificationKind string
const (
	// NotificationKindSimple is a basic notification with just title and description
	NotificationKindSimple NotificationKind = "simple"
	// NotificationKindRecord is a notification that links to a specific record
	NotificationKindRecord NotificationKind = "record"
)

func CastToNotificationKind

func CastToNotificationKind(s string) NotificationKind

CastToNotificationKind converts a string to a typed NotificationKind

func (NotificationKind) String

func (k NotificationKind) String() string

String returns the string representation of the notification kind

type NotificationSet

type NotificationSet []*Notification

NotificationSet slice of Notification

This type is auto-generated.

func (NotificationSet) Filter

func (set NotificationSet) Filter(f func(*Notification) (bool, error)) (out NotificationSet, err error)

Filter iterates through every slice item, calls f(Notification) (bool, err) and return filtered slice

This function is auto-generated.

func (NotificationSet) FindByID

func (set NotificationSet) FindByID(ID uint64) *Notification

FindByID finds items from slice by its ID property

This function is auto-generated.

func (NotificationSet) IDs

func (set NotificationSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (NotificationSet) Walk

func (set NotificationSet) Walk(w func(*Notification) error) (err error)

Walk iterates through every slice item and calls w(Notification) err

This function is auto-generated.

type OpenModeType

type OpenModeType string
const (
	OpenModeModal   OpenModeType = "modal"
	OpenModeNewTab  OpenModeType = "newTab"
	OpenModeSameTab OpenModeType = "sameTab"
)

type PasswordConstraints

type PasswordConstraints struct {
	// Should the environment not enforce the constraints
	PasswordSecurity bool `kv:"-" json:"passwordSecurity"`

	// The min password length
	MinLength uint `kv:"min-length" json:"minLength"`

	// Minimum number of uppercase letters in password
	MinUpperCase uint `kv:"min-upper-case" json:"minUpperCase"`

	// Minimum number of lowercase letters in password
	MinLowerCase uint `kv:"min-lower-case" json:"minLowerCase"`

	// The min number of numeric characters
	MinNumCount uint `kv:"min-num-count" json:"minNumCount"`

	// The min number of special characters
	MinSpecialCount uint `kv:"min-special-count" json:"minSpecialCount"`
}

type Permission

type Permission struct {
	Resource  string `json:"resource"`
	Operation string `json:"operation"`
}

type PrivacyDalConnection

type PrivacyDalConnection struct {
	ID     uint64 `json:"connectionID,string"`
	Handle string `json:"handle"`
	Type   string `json:"type"`

	// descriptions, notes, and other user-provided meta-data
	Meta PrivacyDalConnectionMeta `json:"meta"`

	// collection of configurations for various subsystems that
	// use this connection and how it affects their behaviour
	Config PrivacyDalConnectionConfig `json:"config"`

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	CreatedBy uint64     `json:"createdBy,string" `
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	UpdatedBy uint64     `json:"updatedBy,string,omitempty" `
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
	DeletedBy uint64     `json:"deletedBy,string,omitempty" `
}

type PrivacyDalConnectionConfig

type PrivacyDalConnectionConfig struct {
	Privacy DalConnectionConfigPrivacy `json:"privacy"`
}

type PrivacyDalConnectionMeta

type PrivacyDalConnectionMeta struct {
	Name      string           `json:"name"`
	Ownership string           `json:"ownership"`
	Location  geolocation.Full `json:"location"`
}

type PrivacyDalConnectionSet

type PrivacyDalConnectionSet []*PrivacyDalConnection

PrivacyDalConnectionSet slice of PrivacyDalConnection

This type is auto-generated.

func (PrivacyDalConnectionSet) Filter

Filter iterates through every slice item, calls f(PrivacyDalConnection) (bool, err) and return filtered slice

This function is auto-generated.

func (PrivacyDalConnectionSet) FindByID

FindByID finds items from slice by its ID property

This function is auto-generated.

func (PrivacyDalConnectionSet) IDs

func (set PrivacyDalConnectionSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (PrivacyDalConnectionSet) Walk

func (set PrivacyDalConnectionSet) Walk(w func(*PrivacyDalConnection) error) (err error)

Walk iterates through every slice item and calls w(PrivacyDalConnection) err

This function is auto-generated.

type Queue

type Queue struct {
	ID       uint64    `json:"queueID,string"`
	Consumer string    `json:"consumer"`
	Queue    string    `json:"queue"`
	Meta     QueueMeta `json:"meta"`

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	CreatedBy uint64     `json:"createdBy,string" `
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	UpdatedBy uint64     `json:"updatedBy,string,omitempty" `
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
	DeletedBy uint64     `json:"deletedBy,string,omitempty" `
}

func (*Queue) CanDispatch

func (s *Queue) CanDispatch() bool

func (Queue) GetID

func (r Queue) GetID() uint64

func (*Queue) GetValue

func (r *Queue) GetValue(name string, pos uint) (any, error)

func (Queue) RbacResource

func (r Queue) RbacResource() string

RbacResource returns string representation of RBAC resource for Queue by calling QueueRbacResource fn

RBAC resource is in the corteza::system:queue/... format

This function is auto-generated

func (*Queue) SetValue

func (r *Queue) SetValue(name string, pos uint, value any) (err error)

type QueueFilter

type QueueFilter struct {
	QueueID []string     `json:"queueID"`
	Query   string       `json:"query"`
	Deleted filter.State `json:"deleted"`

	// Check fn is called by store backend for each resource found function can
	// modify the resource and return false if store should not return it
	//
	// Store then loads additional resources to satisfy the paging parameters
	Check func(*Queue) (bool, error) `json:"-"`

	filter.Sorting
	filter.Paging
}

type QueueMessage

type QueueMessage struct {
	ID        uint64     `json:"messageID"`
	Queue     string     `json:"queue"`
	Payload   []byte     `json:"payload"`
	Created   *time.Time `json:"created"`
	Processed *time.Time `json:"processed"`
}

type QueueMessageFilter

type QueueMessageFilter struct {
	Queue string

	Processed filter.State `json:"processed"`

	filter.Sorting
	filter.Paging
}

type QueueMessageSet

type QueueMessageSet []*QueueMessage

QueueMessageSet slice of QueueMessage

This type is auto-generated.

func (QueueMessageSet) Filter

func (set QueueMessageSet) Filter(f func(*QueueMessage) (bool, error)) (out QueueMessageSet, err error)

Filter iterates through every slice item, calls f(QueueMessage) (bool, err) and return filtered slice

This function is auto-generated.

func (QueueMessageSet) Walk

func (set QueueMessageSet) Walk(w func(*QueueMessage) error) (err error)

Walk iterates through every slice item and calls w(QueueMessage) err

This function is auto-generated.

type QueueMeta

type QueueMeta struct {
	PollDelay      *time.Duration `json:"poll_delay"`
	DispatchEvents bool           `json:"dispatch_events"`
}

func ParseQueueMeta

func ParseQueueMeta(ss []string) (p QueueMeta, err error)

func (QueueMeta) MarshalJSON

func (m QueueMeta) MarshalJSON() ([]byte, error)

func (*QueueMeta) Scan

func (m *QueueMeta) Scan(src any) error

func (*QueueMeta) UnmarshalJSON

func (h *QueueMeta) UnmarshalJSON(s []byte) error

func (QueueMeta) Value

func (m QueueMeta) Value() (driver.Value, error)

type QueueSet

type QueueSet []*Queue

QueueSet slice of Queue

This type is auto-generated.

func (QueueSet) Filter

func (set QueueSet) Filter(f func(*Queue) (bool, error)) (out QueueSet, err error)

Filter iterates through every slice item, calls f(Queue) (bool, err) and return filtered slice

This function is auto-generated.

func (QueueSet) FindByID

func (set QueueSet) FindByID(ID uint64) *Queue

FindByID finds items from slice by its ID property

This function is auto-generated.

func (QueueSet) IDs

func (set QueueSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (QueueSet) Walk

func (set QueueSet) Walk(w func(*Queue) error) (err error)

Walk iterates through every slice item and calls w(Queue) err

This function is auto-generated.

type RecordNotificationConfig

type RecordNotificationConfig struct {
	Title       string       `json:"title"`
	Description string       `json:"description"`
	ModuleID    uint64       `json:"moduleID,string"`
	NamespaceID uint64       `json:"namespaceID,string"`
	RecordID    uint64       `json:"recordID,string"`
	OpenMode    OpenModeType `json:"openMode,omitempty"`
	Edit        bool         `json:"edit,omitempty"`
}

RecordNotificationConfig defines the structure for a record notification

type Reminder

type Reminder struct {
	ID          uint64         `json:"reminderID,string"`
	Resource    string         `json:"resource"`
	Payload     types.JSONText `json:"payload"`
	SnoozeCount uint           `json:"snoozeCount"`

	AssignedTo uint64    `json:"assignedTo,string"`
	AssignedBy uint64    `json:"assignedBy,string"`
	AssignedAt time.Time `json:"assignedAt"`

	DismissedBy uint64     `json:"dismissedBy,string"`
	DismissedAt *time.Time `json:"dismissedAt"`

	RemindAt *time.Time `json:"remindAt"`

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
}

type ReminderFilter

type ReminderFilter struct {
	ReminderID       []uint64   `json:"reminderID"`
	Resource         string     `json:"resource"`
	AssignedTo       uint64     `json:"assignedTo,uint64"`
	ScheduledFrom    *time.Time `json:"scheduledFrom"`
	ScheduledUntil   *time.Time `json:"scheduledUntil"`
	ExcludeDismissed bool       `json:"excludeDismissed"`
	IncludeDeleted   bool       `json:"includeDeleted"`
	ScheduledOnly    bool       `json:"scheduledOnly"`

	// Check fn is called by store backend for each resource found function can
	// modify the resource and return false if store should not return it
	//
	// Store then loads additional resources to satisfy the paging parameters
	Check func(*Reminder) (bool, error) `json:"-"`

	// Standard helpers for paging and sorting
	filter.Sorting
	filter.Paging
}

type ReminderSet

type ReminderSet []*Reminder

ReminderSet slice of Reminder

This type is auto-generated.

func (ReminderSet) Filter

func (set ReminderSet) Filter(f func(*Reminder) (bool, error)) (out ReminderSet, err error)

Filter iterates through every slice item, calls f(Reminder) (bool, err) and return filtered slice

This function is auto-generated.

func (ReminderSet) FindByID

func (set ReminderSet) FindByID(ID uint64) *Reminder

FindByID finds items from slice by its ID property

This function is auto-generated.

func (ReminderSet) IDs

func (set ReminderSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (ReminderSet) Walk

func (set ReminderSet) Walk(w func(*Reminder) error) (err error)

Walk iterates through every slice item and calls w(Reminder) err

This function is auto-generated.

type Report

type Report struct {
	ID     uint64      `json:"reportID,string"`
	Handle string      `json:"handle"`
	Meta   *ReportMeta `json:"meta,omitempty"`

	Scenarios ReportScenarioSet   `json:"scenarios,omitempty"`
	Sources   ReportDataSourceSet `json:"sources"`
	Blocks    ReportBlockSet      `json:"blocks"`

	Labels map[string]labelTypes.LabelValue `json:"labels,omitempty"`

	OwnedBy   uint64     `json:"ownedBy"`
	CreatedBy uint64     `json:"createdBy"`
	CreatedAt time.Time  `json:"createdAt"`
	UpdatedBy uint64     `json:"updatedBy,omitempty"`
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	DeletedBy uint64     `json:"deletedBy,omitempty"`
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
}

func (Report) GetID

func (r Report) GetID() uint64

func (Report) GetLabels

func (m Report) GetLabels() map[string]labelTypes.LabelValue

GetLabels adds new label to label map

func (*Report) GetValue

func (r *Report) GetValue(name string, pos uint) (any, error)

func (Report) LabelResourceID

func (m Report) LabelResourceID() uint64

GetLabels adds new label to label map

func (Report) LabelResourceKind

func (Report) LabelResourceKind() string

GetLabels adds new label to label map

func (Report) RbacResource

func (r Report) RbacResource() string

RbacResource returns string representation of RBAC resource for Report by calling ReportRbacResource fn

RBAC resource is in the corteza::system:report/... format

This function is auto-generated

func (*Report) SetLabel

func (m *Report) SetLabel(key string, value labelTypes.LabelValue)

SetLabel adds new label to label map

func (*Report) SetValue

func (r *Report) SetValue(name string, pos uint, value any) (err error)

type ReportAggregateColumn

type ReportAggregateColumn struct {
	Name  string            `json:"name"`
	Label string            `json:"label"`
	Def   *ReportFilterExpr `json:"def"`
}

type ReportAggregateColumnSet

type ReportAggregateColumnSet []*ReportAggregateColumn

type ReportBlock

type ReportBlock struct {
	BlockID     uint64                 `json:"blockID,string"`
	Title       string                 `json:"title"`
	Description string                 `json:"description"`
	Key         string                 `json:"key"`
	Kind        string                 `json:"kind"`
	Options     map[string]interface{} `json:"options,omitempty"`
	Elements    []interface{}          `json:"elements"`
	Sources     ReportStepSet          `json:"sources"`
	XYWH        [4]int                 `json:"xywh"`
	Layout      string                 `json:"layout"`
}

func (*ReportBlock) UnmarshalJSON

func (b *ReportBlock) UnmarshalJSON(data []byte) (err error)

Initial ReportBlock struct definition omitted string casting for the BlockID (sorry) so we need to handle that edge case when reading from DB. @todo consider dropping this in the next/one of the following releases

type ReportBlockSet

type ReportBlockSet []*ReportBlock

func (ReportBlockSet) ReportSteps

func (pp ReportBlockSet) ReportSteps() ReportStepSet

ReportSteps returns a ReportStepSet collected from the ReportBlockSet

func (*ReportBlockSet) Scan

func (vv *ReportBlockSet) Scan(src any) error

func (ReportBlockSet) Value

func (vv ReportBlockSet) Value() (driver.Value, error)

type ReportDataSource

type ReportDataSource struct {
	Meta interface{} `json:"meta,omitempty"`
	Step *ReportStep `json:"step"`
}

type ReportDataSourceSet

type ReportDataSourceSet []*ReportDataSource

func (ReportDataSourceSet) ReportSteps

func (ss ReportDataSourceSet) ReportSteps() ReportStepSet

ReportSteps returns a ReportStepSet collected from the ReportDataSourceSet

func (*ReportDataSourceSet) Scan

func (vv *ReportDataSourceSet) Scan(src any) error

Scan on ReportDataSourceSet gracefully handles conversion from NULL

func (ReportDataSourceSet) Value

func (vv ReportDataSourceSet) Value() (driver.Value, error)

type ReportFilter

type ReportFilter struct {
	ReportID []string `json:"reportID"`

	Handle string `json:"handle"`
	Query  string `json:"query"`

	Deleted filter.State `json:"deleted"`

	LabeledIDs []uint64                         `json:"-"`
	Labels     map[string]labelTypes.LabelValue `json:"labels,omitempty"`

	// Check fn is called by store backend for each resource found function can
	// modify the resource and return false if store should not return it
	//
	// Store then loads additional resources to satisfy the paging parameters
	Check func(*Report) (bool, error) `json:"-"`

	// Standard helpers for paging and sorting
	filter.Sorting
	filter.Paging
}

type ReportFilterExpr

type ReportFilterExpr struct {
	*ast.ASTNode
	Error string `json:"error,omitempty"`
}

ReportFilterExpr is a wrapper for ast.ASTNode to implement custom JSON unmarshal required by reporting. @todo consider moving this to the ql package

func (*ReportFilterExpr) Node

func (f *ReportFilterExpr) Node() *ast.ASTNode

Node is a helper for accessing the wrapped QL node to omit nil checks

func (*ReportFilterExpr) UnmarshalJSON

func (f *ReportFilterExpr) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON parses the wrap into a proper QL node and an optional error

The function can work over JSON strings (where FE provides a QL node) or raw expression strings (where FE sends over the easeier stringified expression).

type ReportLegacyStepGroup

type ReportLegacyStepGroup struct {
	Name    string                   `json:"name"`
	Source  string                   `json:"source"`
	Keys    ReportAggregateColumnSet `json:"keys"`
	Columns ReportAggregateColumnSet `json:"columns"`
	Filter  *ReportFilterExpr        `json:"filter,omitempty"`
}

type ReportMeta

type ReportMeta struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

func ParseReportMeta

func ParseReportMeta(ss []string) (p *ReportMeta, err error)

func (*ReportMeta) Scan

func (vv *ReportMeta) Scan(src any) error

func (*ReportMeta) Value

func (vv *ReportMeta) Value() (driver.Value, error)

type ReportScenario

type ReportScenario struct {
	ScenarioID uint64            `json:"scenarioID,string,omitempty"`
	Label      string            `json:"label"`
	Filters    ScenarioFilterMap `json:"filters,omitempty"`
}

type ReportScenarioSet

type ReportScenarioSet []*ReportScenario

func (*ReportScenarioSet) Scan

func (vv *ReportScenarioSet) Scan(src any) error

func (ReportScenarioSet) Value

func (vv ReportScenarioSet) Value() (driver.Value, error)

type ReportSet

type ReportSet []*Report

ReportSet slice of Report

This type is auto-generated.

func (ReportSet) Filter

func (set ReportSet) Filter(f func(*Report) (bool, error)) (out ReportSet, err error)

Filter iterates through every slice item, calls f(Report) (bool, err) and return filtered slice

This function is auto-generated.

func (ReportSet) FindByID

func (set ReportSet) FindByID(ID uint64) *Report

FindByID finds items from slice by its ID property

This function is auto-generated.

func (ReportSet) IDs

func (set ReportSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (ReportSet) Walk

func (set ReportSet) Walk(w func(*Report) error) (err error)

Walk iterates through every slice item and calls w(Report) err

This function is auto-generated.

type ReportStep

type ReportStep struct {
	Kind string `json:"kind,omitempty"`

	Load      *ReportStepLoad      `json:"load,omitempty"`
	Join      *ReportStepJoin      `json:"join,omitempty"`
	Link      *ReportStepLink      `json:"link,omitempty"`
	Aggregate *ReportStepAggregate `json:"aggregate,omitempty"`

	// @todo remove for the next set of patch/major releases.
	//       it exists just for the migration as we need to rename this one.
	Group_legacy *ReportLegacyStepGroup `json:"group,omitempty"`
}

type ReportStepAggregate

type ReportStepAggregate struct {
	Name    string                   `json:"name"`
	Source  string                   `json:"source"`
	Keys    ReportAggregateColumnSet `json:"keys"`
	Columns ReportAggregateColumnSet `json:"columns"`
	Filter  *ReportFilterExpr        `json:"filter,omitempty"`
}

type ReportStepJoin

type ReportStepJoin struct {
	Name          string            `json:"name"`
	LocalSource   string            `json:"localSource"`
	LocalColumn   string            `json:"localColumn"`
	ForeignSource string            `json:"foreignSource"`
	ForeignColumn string            `json:"foreignColumn"`
	Filter        *ReportFilterExpr `json:"filter,omitempty"`
}
type ReportStepLink struct {
	Name          string            `json:"name"`
	LocalSource   string            `json:"localSource"`
	LocalColumn   string            `json:"localColumn"`
	ForeignSource string            `json:"foreignSource"`
	ForeignColumn string            `json:"foreignColumn"`
	Filter        *ReportFilterExpr `json:"filter,omitempty"`
}

type ReportStepLoad

type ReportStepLoad struct {
	Name       string                 `json:"name"`
	Source     string                 `json:"source"`
	Definition map[string]interface{} `json:"definition"`
	Filter     *ReportFilterExpr      `json:"filter,omitempty"`
}

type ReportStepSet

type ReportStepSet []*ReportStep

type RequestKind

type RequestKind string

func CastToRequestKind

func CastToRequestKind(s string) RequestKind

func (RequestKind) String

func (k RequestKind) String() string

type RequestStatus

type RequestStatus string

func CastToRequestStatus

func CastToRequestStatus(s string) RequestStatus

func (RequestStatus) String

func (s RequestStatus) String() string

type ResourceTranslation

type ResourceTranslation struct {
	ID uint64 `json:"translationID,string"`

	Lang     Lang   `json:"lang"`
	Resource string `json:"resource"`
	K        string `json:"key"`
	Message  string `json:"message"`

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	DeletedAt *time.Time `json:"deletedAt,omitempty"`

	OwnedBy   uint64 `json:"ownedBy,string"`
	CreatedBy uint64 `json:"createdBy,string" `
	UpdatedBy uint64 `json:"updatedBy,string,omitempty" `
	DeletedBy uint64 `json:"deletedBy,string,omitempty" `
}

func (*ResourceTranslation) Compare

func (ResourceTranslation) GetID

func (r ResourceTranslation) GetID() uint64

func (*ResourceTranslation) GetValue

func (r *ResourceTranslation) GetValue(name string, pos uint) (any, error)

func (*ResourceTranslation) SetValue

func (r *ResourceTranslation) SetValue(name string, pos uint, value any) (err error)

type ResourceTranslationFilter

type ResourceTranslationFilter struct {
	TranslationID []string `json:"translationID"`
	Lang          string   `json:"lang"`
	Resource      string   `json:"resource"`
	ResourceType  string   `json:"resourceType"`
	OwnerID       uint64   `json:"ownerID,string"`

	Deleted filter.State `json:"deleted"`

	// Standard helpers for paging and sorting
	filter.Sorting
	filter.Paging
}

type ResourceTranslationSet

type ResourceTranslationSet []*ResourceTranslation

ResourceTranslationSet slice of ResourceTranslation

This type is auto-generated.

func (ResourceTranslationSet) Filter

Filter iterates through every slice item, calls f(ResourceTranslation) (bool, err) and return filtered slice

This function is auto-generated.

func (ResourceTranslationSet) FilterKey

func (set ResourceTranslationSet) FilterKey(key string) (out ResourceTranslationSet)

func (ResourceTranslationSet) FilterLanguage

func (set ResourceTranslationSet) FilterLanguage(tag language.Tag) (out ResourceTranslationSet)

func (ResourceTranslationSet) FilterResource

func (set ResourceTranslationSet) FilterResource(res string) (out ResourceTranslationSet)

func (ResourceTranslationSet) FindByID

FindByID finds items from slice by its ID property

This function is auto-generated.

func (ResourceTranslationSet) IDs

func (set ResourceTranslationSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (ResourceTranslationSet) New

func (ResourceTranslationSet) Old

func (ResourceTranslationSet) Walk

func (set ResourceTranslationSet) Walk(w func(*ResourceTranslation) error) (err error)

Walk iterates through every slice item and calls w(ResourceTranslation) err

This function is auto-generated.

type Role

type Role struct {
	ID     uint64 `json:"roleID,string"`
	Name   string `json:"name"`
	Handle string `json:"handle"`

	Meta   *RoleMeta                        `json:"meta"`
	Labels map[string]labelTypes.LabelValue `json:"labels,omitempty"`

	CreatedAt  time.Time  `json:"createdAt,omitempty"`
	UpdatedAt  *time.Time `json:"updatedAt,omitempty"`
	ArchivedAt *time.Time `json:"archivedAt,omitempty"`
	DeletedAt  *time.Time `json:"deletedAt,omitempty"`
}

func (*Role) Clone

func (r *Role) Clone() *Role

func (Role) GetID

func (r Role) GetID() uint64

func (Role) GetLabels

func (m Role) GetLabels() map[string]labelTypes.LabelValue

GetLabels adds new label to label map

func (*Role) GetValue

func (r *Role) GetValue(name string, pos uint) (any, error)

func (Role) LabelResourceID

func (m Role) LabelResourceID() uint64

GetLabels adds new label to label map

func (Role) LabelResourceKind

func (Role) LabelResourceKind() string

GetLabels adds new label to label map

func (Role) RbacResource

func (r Role) RbacResource() string

RbacResource returns string representation of RBAC resource for Role by calling RoleRbacResource fn

RBAC resource is in the corteza::system:role/... format

This function is auto-generated

func (*Role) SetLabel

func (m *Role) SetLabel(key string, value labelTypes.LabelValue)

SetLabel adds new label to label map

func (*Role) SetValue

func (r *Role) SetValue(name string, pos uint, value any) (err error)

type RoleContext

type RoleContext struct {
	Resource []string `json:"resourceTypes,omitempty" yaml:"resourceType"`
	Expr     string   `json:"expr,omitempty"`
}

type RoleFilter

type RoleFilter struct {
	RoleID      []string `json:"roleID"`
	MemberID    uint64   `json:"memberID,string"`
	UserGroupID uint64   `json:"userGroupID,string"`

	// @todo will migrate from MemberID/UserGroupID in a later releae
	// For internal use only
	Resource string `json:"-"`

	Query string `json:"query"`

	Handle string `json:"handle"`
	Name   string `json:"name"`

	Deleted  filter.State `json:"deleted"`
	Archived filter.State `json:"archived"`

	LabeledIDs []uint64                         `json:"-"`
	Labels     map[string]labelTypes.LabelValue `json:"labels,omitempty"`

	// Check fn is called by store backend for each resource found function can
	// modify the resource and return false if store should not return it
	//
	// Store then loads additional resources to satisfy the paging parameters
	Check func(*Role) (bool, error) `json:"-"`

	// Standard helpers for paging and sorting
	filter.Sorting
	filter.Paging
}

type RoleMember

type RoleMember struct {
	RoleID   uint64
	Resource string
}

func (RoleMember) GetID

func (r RoleMember) GetID() uint64

func (*RoleMember) GetValue

func (r *RoleMember) GetValue(name string, pos uint) (any, error)

func (*RoleMember) SetValue

func (r *RoleMember) SetValue(name string, pos uint, value any) (err error)

type RoleMemberFilter

type RoleMemberFilter struct {
	RoleID   uint64
	Resource string
	Limit    uint
}

type RoleMemberSet

type RoleMemberSet []*RoleMember

RoleMemberSet slice of RoleMember

This type is auto-generated.

func (RoleMemberSet) Filter

func (set RoleMemberSet) Filter(f func(*RoleMember) (bool, error)) (out RoleMemberSet, err error)

Filter iterates through every slice item, calls f(RoleMember) (bool, err) and return filtered slice

This function is auto-generated.

func (RoleMemberSet) Walk

func (set RoleMemberSet) Walk(w func(*RoleMember) error) (err error)

Walk iterates through every slice item and calls w(RoleMember) err

This function is auto-generated.

type RoleMeta

type RoleMeta struct {
	Description string       `json:"description,omitempty"`
	Context     *RoleContext `json:"context,omitempty"`
}

func ParseRoleMeta

func ParseRoleMeta(ss []string) (p *RoleMeta, err error)

func (*RoleMeta) Scan

func (vv *RoleMeta) Scan(src any) error

func (*RoleMeta) Value

func (vv *RoleMeta) Value() (driver.Value, error)

type RoleMetrics

type RoleMetrics struct {
	Total         uint   `json:"total"`
	Valid         uint   `json:"valid"`
	Deleted       uint   `json:"deleted"`
	Archived      uint   `json:"archived"`
	DailyCreated  []uint `json:"dailyCreated"`
	DailyDeleted  []uint `json:"dailyDeleted"`
	DailyUpdated  []uint `json:"dailyUpdated"`
	DailyArchived []uint `json:"dailyArchived"`
}

type RoleSet

type RoleSet []*Role

RoleSet slice of Role

This type is auto-generated.

func (RoleSet) Filter

func (set RoleSet) Filter(f func(*Role) (bool, error)) (out RoleSet, err error)

Filter iterates through every slice item, calls f(Role) (bool, err) and return filtered slice

This function is auto-generated.

func (RoleSet) FindByHandle

func (set RoleSet) FindByHandle(handle string) *Role

FindByHandle finds role by it's handle

func (RoleSet) FindByID

func (set RoleSet) FindByID(ID uint64) *Role

FindByID finds items from slice by its ID property

This function is auto-generated.

func (RoleSet) IDs

func (set RoleSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (RoleSet) Walk

func (set RoleSet) Walk(w func(*Role) error) (err error)

Walk iterates through every slice item and calls w(Role) err

This function is auto-generated.

type ScenarioFilterMap

type ScenarioFilterMap map[string]ReportFilterExpr

type SettingValue

type SettingValue struct {
	Name  string         `json:"name"`
	Value types.JSONText `json:"value"`

	// Setting owner, 0 for global settings
	OwnedBy uint64 `json:"-"`

	// Who updated & when
	UpdatedAt time.Time `json:"updatedAt"`
	UpdatedBy uint64    `json:"updatedBy"`
}

func MakeSettingValue

func MakeSettingValue(name string, value interface{}) *SettingValue

func (*SettingValue) Bool

func (v *SettingValue) Bool() (out bool)

func (*SettingValue) Eq

func (v *SettingValue) Eq(c *SettingValue) bool

func (*SettingValue) GetID

func (v *SettingValue) GetID() uint64

These functions exist only to satisfy pkg/envoyx interfaces

func (*SettingValue) GetValue

func (v *SettingValue) GetValue(string, uint) (any, error)

func (*SettingValue) IsNull

func (v *SettingValue) IsNull() (out bool)

func (*SettingValue) NormalizeValue

func (v *SettingValue) NormalizeValue()

func (*SettingValue) SetRawSetting

func (v *SettingValue) SetRawSetting(str string) error

func (*SettingValue) SetSetting

func (v *SettingValue) SetSetting(value interface{}) (err error)

func (*SettingValue) SetValue

func (v *SettingValue) SetValue(string, uint, any) error

func (*SettingValue) String

func (v *SettingValue) String() (out string)

type SettingValueSet

type SettingValueSet []*SettingValue

SettingValueSet slice of SettingValue

This type is auto-generated.

func (SettingValueSet) Changed

func (set SettingValueSet) Changed(in SettingValueSet) (out SettingValueSet)

Returns all valus that changed or do not exist in the original set

func (SettingValueSet) Filter

func (set SettingValueSet) Filter(f func(*SettingValue) (bool, error)) (out SettingValueSet, err error)

Filter iterates through every slice item, calls f(SettingValue) (bool, err) and return filtered slice

This function is auto-generated.

func (SettingValueSet) FilterByPrefix

func (set SettingValueSet) FilterByPrefix(prefix string) SettingValueSet

func (SettingValueSet) FindByName

func (set SettingValueSet) FindByName(name string) *SettingValue

func (SettingValueSet) First

func (set SettingValueSet) First(name string) *SettingValue

First finds and returns first value

func (*SettingValueSet) Has

func (set *SettingValueSet) Has(name string) bool

Replace finds and updates existing or appends new value

func (SettingValueSet) KV

func (set SettingValueSet) KV() SettingsKV

func (SettingValueSet) New

New returns all new values (that do not exist in the original set)

func (SettingValueSet) Old

New returns all old values (that exist in the original set)

func (*SettingValueSet) Replace

func (set *SettingValueSet) Replace(n *SettingValue)

Replace finds and updates existing or appends new value

func (SettingValueSet) Trash

func (set SettingValueSet) Trash() (out SettingValueSet)

Trash returns values from the set that were set ti nil

func (SettingValueSet) Walk

func (set SettingValueSet) Walk(w func(*SettingValue) error) (err error)

Walk iterates through every slice item and calls w(SettingValue) err

This function is auto-generated.

type SettingsFilter

type SettingsFilter struct {
	Prefix  string `json:"prefix"`
	OwnedBy uint64 `json:"ownedBy"`

	// Check fn is called by store backend for each resource found function can
	// modify the resource and return false if store should not return it
	//
	// Store then loads additional resources to satisfy the paging parameters
	Check func(*SettingValue) (bool, error) `json:"-"`

	Limit uint `json:"-"`
}

type SettingsKV

type SettingsKV map[string]types.JSONText

func (SettingsKV) Bool

func (kv SettingsKV) Bool(k string) (out bool)

func (SettingsKV) CutPrefix

func (kv SettingsKV) CutPrefix(prefix string) SettingsKV

CutPrefix returns values with matching prefix and removes the prefix from keys

func (SettingsKV) Decode

func (kv SettingsKV) Decode(dst interface{}) error

Decode is a helper function on SettingsKV that calls DecodeKV() and passes on the dst

func (SettingsKV) Filter

func (kv SettingsKV) Filter(prefix string) SettingsKV

func (SettingsKV) Has

func (kv SettingsKV) Has(k string) (ok bool)

func (SettingsKV) String

func (kv SettingsKV) String(k string) (out string)

type SimpleNotificationConfig

type SimpleNotificationConfig struct {
	Title       string `json:"title"`
	Description string `json:"description"`
}

SimpleNotificationConfig defines the structure for a simple notification

type SinkRequest

type SinkRequest struct {
	Method string      `json:"method"`
	Path   string      `json:"path"`
	Host   string      `json:"host"`
	Header http.Header `json:"header"`
	Query  url.Values  `json:"query"`

	Username   string `json:"username"`
	Password   string `json:"password"`
	RemoteAddr string `json:"remoteAddress"`

	// Make sure to set content-type to
	// application/octet-stream or application/x-www-form-urlencoded
	// to fill up PostForm
	PostForm url.Values `json:"postForm"`

	// RawBody will be base64 encoded!
	// (might contain binary data)
	Body []byte `json:"rawBody,string"`
}

func NewSinkRequest

func NewSinkRequest(r *http.Request, body io.Reader) (sr *SinkRequest, err error)

type SinkResponse

type SinkResponse struct {
	Status int         `json:"status"`
	Header http.Header `json:"header"`
	Body   interface{} `json:"body,string"`
}

type SmtpCheckResult

type SmtpCheckResult struct {
	Host   string `json:"host"`
	Server string `json:"server"`
	Send   string `json:"send"`
}

SmtpCheckResult represents the messages returned after SMTP Host validation, SMTP Server configurations check and Send test email process

type SmtpConfiguration

type SmtpConfiguration struct {
	Host          string
	Port          uint
	Recipients    []string
	Username      string
	Password      string
	TLSInsecure   bool
	TLSServerName string
}

type SmtpServers

type SmtpServers struct {
	Host          string `json:"host"`
	Port          int    `json:"port,string"`
	User          string `json:"user"`
	Pass          string `json:"pass"`
	From          string `json:"from"`
	TlsInsecure   bool   `json:"tlsInsecure"`
	TlsServerName string `json:"tlsServerName"`
}

type Template

type Template struct {
	ID     uint64 `json:"templateID,string"`
	Handle string `json:"handle"`
	// Language specifies the language the template is written for; leave empty for default
	Language string `json:"language"`

	Type DocumentType `json:"type"`
	// Partial templates can be used to construct larger templates; for example headers and footers
	Partial bool `json:"partial"`
	// use int so JS can handle it normally
	//
	// @todo We'll handle this at a later point
	// Revision int           `json:"revision,string"`
	Meta TemplateMeta `json:"meta"`

	Template string `json:"template"`

	Labels map[string]labelTypes.LabelValue `json:"labels,omitempty"`

	OwnerID    uint64     `json:"ownerID,string"`
	CreatedAt  time.Time  `json:"createdAt,omitempty"`
	UpdatedAt  *time.Time `json:"updatedAt,omitempty"`
	DeletedAt  *time.Time `json:"deletedAt,omitempty"`
	LastUsedAt *time.Time `json:"lastUsedAt,omitempty"`
}

func (Template) Clone

func (t Template) Clone() *Template

func (Template) GetID

func (r Template) GetID() uint64

func (Template) GetLabels

func (m Template) GetLabels() map[string]labelTypes.LabelValue

GetLabels adds new label to label map

func (*Template) GetValue

func (r *Template) GetValue(name string, pos uint) (any, error)

func (Template) LabelResourceID

func (m Template) LabelResourceID() uint64

GetLabels adds new label to label map

func (Template) LabelResourceKind

func (Template) LabelResourceKind() string

GetLabels adds new label to label map

func (Template) RbacResource

func (r Template) RbacResource() string

RbacResource returns string representation of RBAC resource for Template by calling TemplateRbacResource fn

RBAC resource is in the corteza::system:template/... format

This function is auto-generated

func (*Template) SetLabel

func (m *Template) SetLabel(key string, value labelTypes.LabelValue)

SetLabel adds new label to label map

func (*Template) SetValue

func (r *Template) SetValue(name string, pos uint, value any) (err error)

type TemplateFilter

type TemplateFilter struct {
	TemplateID []string `json:"templateID"`
	Query      string   `json:"query"`
	Handle     string   `json:"handle"`
	Type       string   `json:"type"`
	OwnerID    uint64   `json:"ownerID,string"`
	Partial    bool     `json:"partial"`

	LabeledIDs []uint64                         `json:"-"`
	Labels     map[string]labelTypes.LabelValue `json:"labels,omitempty"`

	// Check fn is called by store backend for each resource found function can
	// modify the resource and return false if store should not return it
	//
	// Store then loads additional resources to satisfy the paging parameters
	Check func(*Template) (bool, error) `json:"-"`

	Deleted filter.State `json:"deleted"`

	// Standard helpers for paging and sorting
	filter.Sorting
	filter.Paging
}

type TemplateMeta

type TemplateMeta struct {
	Short       string `json:"short"`
	Description string `json:"description,omitempty"`
}

func ParseTemplateMeta

func ParseTemplateMeta(ss []string) (p TemplateMeta, err error)

func (*TemplateMeta) Scan

func (t *TemplateMeta) Scan(src any) error

func (TemplateMeta) Value

func (t TemplateMeta) Value() (driver.Value, error)

type TemplateSet

type TemplateSet []*Template

TemplateSet slice of Template

This type is auto-generated.

func (TemplateSet) Filter

func (set TemplateSet) Filter(f func(*Template) (bool, error)) (out TemplateSet, err error)

Filter iterates through every slice item, calls f(Template) (bool, err) and return filtered slice

This function is auto-generated.

func (TemplateSet) FindByID

func (set TemplateSet) FindByID(ID uint64) *Template

FindByID finds items from slice by its ID property

This function is auto-generated.

func (TemplateSet) IDs

func (set TemplateSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (TemplateSet) Walk

func (set TemplateSet) Walk(w func(*Template) error) (err error)

Walk iterates through every slice item and calls w(Template) err

This function is auto-generated.

type Theme

type Theme struct {
	ID     string `json:"id"`
	Values string `json:"values"`
}

type User

type User struct {
	ID       uint64   `json:"userID,string"`
	Username string   `json:"username"`
	Email    string   `json:"email"`
	Name     string   `json:"name"`
	Handle   string   `json:"handle"`
	Kind     UserKind `json:"kind"`

	UserGroupID uint64 `json:"userGroupID,string"`

	Meta *UserMeta `json:"meta"`

	EmailConfirmed bool `json:"emailConfirmed"`

	Labels map[string]labelTypes.LabelValue `json:"labels,omitempty"`

	CreatedAt   time.Time  `json:"createdAt,omitempty"`
	UpdatedAt   *time.Time `json:"updatedAt,omitempty"`
	SuspendedAt *time.Time `json:"suspendedAt,omitempty"`
	DeletedAt   *time.Time `json:"deletedAt,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Clone

func (u *User) Clone() *User

func (User) GetID

func (r User) GetID() uint64

func (User) GetLabels

func (m User) GetLabels() map[string]labelTypes.LabelValue

GetLabels adds new label to label map

func (*User) GetValue

func (r *User) GetValue(name string, pos uint) (any, error)

func (User) Identity

func (u User) Identity() uint64

func (User) LabelResourceID

func (m User) LabelResourceID() uint64

GetLabels adds new label to label map

func (User) LabelResourceKind

func (User) LabelResourceKind() string

GetLabels adds new label to label map

func (User) RbacResource

func (r User) RbacResource() string

RbacResource returns string representation of RBAC resource for User by calling UserRbacResource fn

RBAC resource is in the corteza::system:user/... format

This function is auto-generated

func (User) Roles

func (u User) Roles() []uint64

func (*User) SetLabel

func (m *User) SetLabel(key string, value labelTypes.LabelValue)

SetLabel adds new label to label map

func (*User) SetRoles

func (u *User) SetRoles(rr ...uint64)

func (*User) SetValue

func (r *User) SetValue(name string, pos uint, value any) (err error)

func (User) String

func (u User) String() string

func (*User) Valid

func (u *User) Valid() bool

type UserFilter

type UserFilter struct {
	UserID      []string `json:"userID"`
	RoleID      []string `json:"roleID"`
	UserGroupID uint64   `json:"userGroupID,string"`
	Query       string   `json:"query"`
	Email       string   `json:"email"`
	Username    string   `json:"username"`
	Handle      string   `json:"handle"`
	Kind        UserKind `json:"kind"`

	// Set to true if you want to get all kinds/types of users
	AllKinds bool `json:"anyKind"`

	LabeledIDs []uint64                         `json:"-"`
	Labels     map[string]labelTypes.LabelValue `json:"labels,omitempty"`

	Deleted   filter.State `json:"deleted"`
	Suspended filter.State `json:"suspended"`

	// Check fn is called by store backend for each resource found function can
	// modify the resource and return false if store should not return it
	//
	// Store then loads additional resources to satisfy the paging parameters
	Check func(*User) (bool, error) `json:"-"`

	MaskedEmailsEnabled bool `json:"-"`
	MaskedNamesEnabled  bool `json:"-"`

	// Standard helpers for paging and sorting
	filter.Sorting
	filter.Paging
}

type UserGroup

type UserGroup struct {
	ID     uint64 `json:"userGroupID,string"`
	Handle string `json:"handle"`

	Config *UserGroupConfig `json:"config"`

	IsRoot bool `json:"isRoot"`

	Meta   *UserGroupMeta                   `json:"meta"`
	Labels map[string]labelTypes.LabelValue `json:"labels,omitempty"`

	CreatedAt  time.Time  `json:"createdAt,omitempty"`
	UpdatedAt  *time.Time `json:"updatedAt,omitempty"`
	ArchivedAt *time.Time `json:"archivedAt,omitempty"`
	DeletedAt  *time.Time `json:"deletedAt,omitempty"`
}

func (*UserGroup) Clone

func (r *UserGroup) Clone() *UserGroup

func (UserGroup) GetID

func (r UserGroup) GetID() uint64

func (UserGroup) GetLabels

func (m UserGroup) GetLabels() map[string]labelTypes.LabelValue

GetLabels adds new label to label map

func (*UserGroup) GetValue

func (r *UserGroup) GetValue(name string, pos uint) (any, error)

func (UserGroup) LabelResourceID

func (m UserGroup) LabelResourceID() uint64

GetLabels adds new label to label map

func (UserGroup) LabelResourceKind

func (UserGroup) LabelResourceKind() string

GetLabels adds new label to label map

func (UserGroup) RbacResource

func (r UserGroup) RbacResource() string

RbacResource returns string representation of RBAC resource for UserGroup by calling UserGroupRbacResource fn

RBAC resource is in the corteza::system:user-group/... format

This function is auto-generated

func (*UserGroup) SetLabel

func (m *UserGroup) SetLabel(key string, value labelTypes.LabelValue)

SetLabel adds new label to label map

func (*UserGroup) SetValue

func (r *UserGroup) SetValue(name string, pos uint, value any) (err error)

type UserGroupConfig

type UserGroupConfig struct {
	Paths []UserGroupPath `json:"path"`
}

func ParseUserGroupConfig

func ParseUserGroupConfig(ss []string) (p *UserGroupConfig, err error)

func (*UserGroupConfig) Scan

func (vv *UserGroupConfig) Scan(src any) error

func (*UserGroupConfig) Value

func (vv *UserGroupConfig) Value() (driver.Value, error)

type UserGroupFilter

type UserGroupFilter struct {
	UserGroupID []string `json:"userGroupID"`
	MemberID    uint64   `json:"memberID,string"`

	Query string `json:"query"`

	Handle string `json:"handle"`
	Name   string `json:"name"`

	Deleted  filter.State `json:"deleted"`
	Archived filter.State `json:"archived"`

	LabeledIDs []uint64                         `json:"-"`
	Labels     map[string]labelTypes.LabelValue `json:"labels,omitempty"`

	// Check fn is called by store backend for each resource found function can
	// modify the resource and return false if store should not return it
	//
	// Store then loads additional resources to satisfy the paging parameters
	Check func(*UserGroup) (bool, error) `json:"-"`

	// Standard helpers for paging and sorting
	filter.Sorting
	filter.Paging
}

type UserGroupMeta

type UserGroupMeta struct {
	Description string `json:"description"`
	Short       string `json:"short"`
}

func ParseUserGroupMeta

func ParseUserGroupMeta(ss []string) (p *UserGroupMeta, err error)

func (*UserGroupMeta) Scan

func (vv *UserGroupMeta) Scan(src any) error

func (*UserGroupMeta) Value

func (vv *UserGroupMeta) Value() (driver.Value, error)

type UserGroupPath

type UserGroupPath struct {
	SelfID uint64 `json:"selfID,string"`
	Name   string `json:"name"`
}

type UserGroupSet

type UserGroupSet []*UserGroup

UserGroupSet slice of UserGroup

This type is auto-generated.

func (UserGroupSet) Filter

func (set UserGroupSet) Filter(f func(*UserGroup) (bool, error)) (out UserGroupSet, err error)

Filter iterates through every slice item, calls f(UserGroup) (bool, err) and return filtered slice

This function is auto-generated.

func (UserGroupSet) FindByHandle

func (set UserGroupSet) FindByHandle(handle string) *UserGroup

FindByHandle finds userGroup by it's handle

func (UserGroupSet) FindByID

func (set UserGroupSet) FindByID(ID uint64) *UserGroup

FindByID finds items from slice by its ID property

This function is auto-generated.

func (UserGroupSet) IDs

func (set UserGroupSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (UserGroupSet) Walk

func (set UserGroupSet) Walk(w func(*UserGroup) error) (err error)

Walk iterates through every slice item and calls w(UserGroup) err

This function is auto-generated.

type UserKind

type UserKind string
const (
	NormalUser UserKind = ""
	SystemUser UserKind = "sys"
)

type UserMeta

type UserMeta struct {
	// User's profile avatar photo attachment ID
	AvatarID   uint64 `json:"avatarID,string"`
	AvatarKind string `json:"avatarKind,omitempty"`

	// User's avatar initial text and background color
	AvatarColor   string `json:"avatarColor,omitempty"`
	AvatarBgColor string `json:"avatarBgColor,omitempty"`

	PreferredLanguage string `json:"preferredLanguage"`
	Theme             string `json:"theme"`

	// User's security policy settings
	SecurityPolicy struct {
		// settings for multi-factor authentication
		MFA struct {
			// Enforce OTP on login
			EnforcedEmailOTP bool `json:"enforcedEmailOTP"`

			// Is TOTP configured & enforced?
			EnforcedTOTP bool `json:"enforcedTOTP"`
		} `json:"mfa"`
	} `json:"securityPolicy"`
}

func ParseUserMeta

func ParseUserMeta(ss []string) (p *UserMeta, err error)

func (*UserMeta) Scan

func (meta *UserMeta) Scan(src any) error

func (*UserMeta) Value

func (meta *UserMeta) Value() (driver.Value, error)

type UserMetrics

type UserMetrics struct {
	Total          uint   `json:"total"`
	Valid          uint   `json:"valid"`
	Deleted        uint   `json:"deleted"`
	Suspended      uint   `json:"suspended"`
	DailyCreated   []uint `json:"dailyCreated"`
	DailyDeleted   []uint `json:"dailyDeleted"`
	DailyUpdated   []uint `json:"dailyUpdated"`
	DailySuspended []uint `json:"dailySuspended"`
}

type UserSet

type UserSet []*User

UserSet slice of User

This type is auto-generated.

func (UserSet) Filter

func (set UserSet) Filter(f func(*User) (bool, error)) (out UserSet, err error)

Filter iterates through every slice item, calls f(User) (bool, err) and return filtered slice

This function is auto-generated.

func (UserSet) FindByID

func (set UserSet) FindByID(ID uint64) *User

FindByID finds items from slice by its ID property

This function is auto-generated.

func (UserSet) IDs

func (set UserSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (UserSet) Walk

func (set UserSet) Walk(w func(*User) error) (err error)

Walk iterates through every slice item and calls w(User) err

This function is auto-generated.

Jump to

Keyboard shortcuts

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