types

package
v0.0.0-...-2873e01 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 25 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"
)
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"
	ReportResourceType                    = "corteza::system:report"
	ResourceTranslationResourceType       = "corteza::system:resource-translation"
	RoleResourceType                      = "corteza::system:role"
	RoleMemberResourceType                = "corteza::system:role-member"
	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"
	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 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 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 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 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 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 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"`
}

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"`

		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 "Corteza"
				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"`

	// 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 {
			SassInstalled bool `kv:"sass-installed" json:"sass-installed"`

			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"`

			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"`
		} `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"`
	} `kv:"ui" json:"ui"`

	ResourceTranslations struct {

		// This is always a subset of all languages available
		// in Corteza 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]string `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]string

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 string)

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]string `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]string `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]string

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 string)

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]string `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"`

	// 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 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 ConnectionConfig

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

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

func ParseConnectionConfig

func ParseConnectionConfig(ss []string) (m ConnectionConfig, err error)

func (*ConnectionConfig) Scan

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

func (ConnectionConfig) Value

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

type ConnectionConfigDAL

type ConnectionConfigDAL 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"`
}

ConnectionConfigDAL a set of connection parameters and model configuration

type ConnectionConfigPrivacy

type ConnectionConfigPrivacy 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 ConnectionMeta

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

func ParseConnectionMeta

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

func (*ConnectionMeta) Scan

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

func (ConnectionMeta) Value

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

type ConnectionMetaProperties

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

type ConnectionMetaProperty

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

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 ConnectionMeta `json:"meta"`

	// collection of configurations for various subsystems that
	// use this connection and how it affects their behaviour
	Config ConnectionConfig `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 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 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 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 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 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 ConnectionConfigPrivacy `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 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]string `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]string

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 string)

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]string `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 {
	*ql.ASTNode
	Error string `json:"error,omitempty"`
}

ReportFilterExpr is a wrapper for ql.ASTNode to implement custom JSON unmarshal required by reporting. @todo consider moving this to the ql package

func (*ReportFilterExpr) Node

func (f *ReportFilterExpr) Node() *ql.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]string `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]string

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 string)

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"`

	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]string `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
	UserID uint64
}

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
	UserID uint64
	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 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]string `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]string

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 string)

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]string `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"`

	Meta *UserMeta `json:"meta"`

	EmailConfirmed bool `json:"emailConfirmed"`

	Labels map[string]string `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]string

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 string)

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"`
	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]string `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 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