models

package
v0.0.0-...-a49490a Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	ID                uuid.UUID `json:"id"`
	Name              string    `json:"name"`
	Description       string    `json:"description"`
	Plugin            string    `json:"plugin"`
	Version           string    `json:"version"`
	Icon              string    `json:"icon"`
	Category          string    `json:"category"`
	Active            bool      `json:"active"`
	Params            []Params  `json:"params"`
	CustomName        string    `json:"custom_name"`
	CustomDescription string    `json:"custom_description"`
	FailurePipelineID string    `json:"failure_pipeline_id"`
	UpdateAvailable   bool      `json:"update_available"`
	UpdateVersion     string    `json:"update_version,omitempty"`
	UpdatedAction     *Action   `json:"updated_action,omitempty"`
	Condition         Condition `json:"condition,omitempty"`
}

type AdminProjectsWithMembers

type AdminProjectsWithMembers struct {
	Projects
	Members []ProjectMembersWithUserData `json:"members"`
}

type AlertEndpoints

type AlertEndpoints struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Endpoint string `json:"endpoint"`
	Icon     string `json:"icon"`
	Color    string `json:"color"`
}

type Alerts

type Alerts struct {
	bun.BaseModel `bun:"table:alerts"`

	ID          uuid.UUID       `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	Name        string          `bun:"name,type:text,default:''" json:"name"`
	Status      string          `bun:"status,type:text,default:''" json:"status"`
	Payload     json.RawMessage `bun:"payload,type:jsonb,default:jsonb('[]')" json:"payload"`
	FlowID      string          `bun:"flow_id,type:text,default:''" json:"flow_id"`
	ExecutionID string          `bun:"execution_id,type:text,default:''" json:"execution_id"`
	RunnerID    string          `bun:"runner_id,type:text,default:''" json:"runner_id"`
	ParentID    string          `bun:"parent_id,type:text,default:''" json:"parent_id"`
	Plugin      string          `bun:"plugin,type:text,default:''" json:"plugin"`
	CreatedAt   time.Time       `bun:"created_at,type:timestamptz,default:now()" json:"created_at"`
	Encrypted   bool            `bun:"encrypted,type:bool,default:false" json:"encrypted"`
	UpdatedAt   time.Time       `bun:"updated_at,type:timestamptz" json:"updated_at"`
	ResolvedAt  time.Time       `bun:"resolved_at,type:timestamptz" json:"resolved_at"`
	GroupKey    string          `bun:"group_key,type:text,default:''" json:"group_key"`
	SubAlerts   []SubAlerts     `bun:"sub_alerts,type:jsonb,default:jsonb('[]')" json:"sub_alerts"`
	Note        string          `bun:"note,type:text,default:''" json:"note"`
}

type Audit

type Audit struct {
	bun.BaseModel `bun:"table:audit"`

	ID        uuid.UUID `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	ProjectID string    `bun:"project_id,type:text,notnull" json:"project_id"`
	UserID    string    `bun:"user_id,type:text,notnull" json:"user_id"`
	Operation string    `bun:"operation,type:text,notnull" json:"operation"`
	Details   string    `bun:"details,type:text,default:''" json:"details"`
	CreatedAt time.Time `bun:"created_at,type:timestamptz,default:now()" json:"created_at"`
}

type AuditWithUser

type AuditWithUser struct {
	bun.BaseModel `bun:"table:audit"`

	ID        uuid.UUID `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	ProjectID string    `bun:"project_id,type:text,notnull" json:"project_id"`
	UserID    string    `bun:"user_id,type:text,notnull" json:"user_id"`
	Operation string    `bun:"operation,type:text,notnull" json:"operation"`
	Details   string    `bun:"details,type:text,default:''" json:"details"`
	CreatedAt time.Time `bun:"created_at,type:timestamptz,default:now()" json:"created_at"`
	Username  string    `bun:"username,type:text" json:"username"`
	Email     string    `bun:"email,type:text" json:"email"`
	Role      string    `bun:"role,type:text" json:"role"`
}

type Condition

type Condition struct {
	SelectedActionID string          `json:"selected_action_id"`
	ConditionItems   []ConditionItem `json:"condition_items"`
	CancelExecution  bool            `json:"cancel_execution"`
}

type ConditionItem

type ConditionItem struct {
	ConditionKey   string `json:"condition_key"`
	ConditionType  string `json:"condition_type"`
	ConditionValue string `json:"condition_value"`
	ConditionLogic string `json:"condition_logic"` // e.g., "AND", "OR"
}

type DependsOn

type DependsOn struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Endpoint

type Endpoint struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Path  string `json:"path"`
	Icon  string `json:"icon"`
	Color string `json:"color"`
}

type ExecutionSteps

type ExecutionSteps struct {
	bun.BaseModel `bun:"table:execution_steps"`

	ID                  uuid.UUID `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	ExecutionID         string    `bun:"execution_id,type:text,notnull" json:"execution_id"`
	Action              Action    `bun:"action,type:jsonb,default:jsonb('{}')" json:"action"`
	Messages            []Message `bun:"messages,type:jsonb,default:jsonb('[]')" json:"messages"`
	RunnerID            string    `bun:"runner_id,type:text,default:''" json:"runner_id"`
	ParentID            string    `bun:"parent_id,type:text,default:''" json:"parent_id"`
	IsHidden            bool      `bun:"is_hidden,type:bool,default:false" json:"is_hidden"`
	Status              string    `bun:"status,type:text,default:''" json:"status"`
	Encrypted           bool      `bun:"encrypted,type:bool,default:false" json:"encrypted"`
	Interactive         bool      `bun:"interactive,type:bool,default:false" json:"interactive"`
	Interacted          bool      `bun:"interacted,type:bool,default:false" json:"interacted"`
	InteractionApproved bool      `bun:"interaction_approved,type:bool,default:false" json:"interaction_approved"`
	InteractionRejected bool      `bun:"interaction_rejected,type:bool,default:false" json:"interaction_rejected"`
	InteractedBy        string    `bun:"interacted_by,type:text,default:''" json:"interacted_by"`
	InteractedAt        time.Time `bun:"interacted_at,type:timestamptz" json:"interacted_at"`
	CanceledBy          string    `bun:"canceled_by,type:text,default:''" json:"canceled_by"`
	CanceledAt          time.Time `bun:"canceled_at,type:timestamptz" json:"canceled_at"`
	CreatedAt           time.Time `bun:"created_at,type:timestamptz,default:now()" json:"created_at"`
	StartedAt           time.Time `bun:"started_at,type:timestamptz" json:"started_at"`
	FinishedAt          time.Time `bun:"finished_at,type:timestamptz" json:"finished_at"`
}

type ExecutionWithSteps

type ExecutionWithSteps struct {
	Executions
	Steps []ExecutionSteps `json:"steps"`
}

type Executions

type Executions struct {
	bun.BaseModel `bun:"table:executions"`

	ID            uuid.UUID `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	FlowID        string    `bun:"flow_id,type:text,default:''" json:"flow_id"`
	RunnerID      string    `bun:"runner_id,type:text,default:''" json:"runner_id"`
	Status        string    `bun:"status,type:text,default:''" json:"status"`
	CreatedAt     time.Time `bun:"created_at,type:timestamptz,default:now()" json:"created_at"`
	ExecutedAt    time.Time `bun:"executed_at,type:timestamptz" json:"executed_at"`
	FinishedAt    time.Time `bun:"finished_at,type:timestamptz" json:"finished_at"`
	LastHeartbeat time.Time `bun:"last_heartbeat,type:timestamptz" json:"last_heartbeat"`
	ScheduledAt   time.Time `bun:"scheduled_at,type:timestamptz" json:"scheduled_at"`
	TriggeredBy   string    `bun:"triggered_by,type:text,default:'user'" json:"triggered_by"`
	AlertID       string    `bun:"alert_id,type:text,default:''" json:"alert_id"`
}

type FailurePipeline

type FailurePipeline struct {
	ID           uuid.UUID `json:"id"`
	Name         string    `json:"name"`
	Actions      []Action  `json:"actions"`
	ExecParallel bool      `json:"exec_parallel"`
}

type Flows

type Flows struct {
	bun.BaseModel `bun:"table:flows"`

	ID                     uuid.UUID         `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	Name                   string            `bun:"name,type:text,notnull" json:"name"`
	Description            string            `bun:"description,type:text,default:''" json:"description"`
	Type                   string            `bun:"type,type:text,default:'default'" json:"type"`
	ProjectID              string            `bun:"project_id,type:text,notnull" json:"project_id"`
	RunnerID               string            `bun:"runner_id,type:text,default:''" json:"runner_id"`
	ExecParallel           bool              `bun:"exec_parallel,type:bool,default:false" json:"exec_parallel"`
	Actions                []Action          `bun:"type:jsonb,default:jsonb('[]')" json:"actions"`
	Maintenance            bool              `bun:"maintenance,type:bool,default:false" json:"maintenance"`
	MaintenanceMessage     string            `bun:"maintenance_message,type:text,default:''" json:"maintenance_message"`
	Disabled               bool              `bun:"disabled,type:bool,default:false" json:"disabled"`
	DisabledReason         string            `bun:"disabled_reason,type:text,default:''" json:"disabled_reason"`
	CreatedAt              time.Time         `bun:"created_at,type:timestamptz,default:now()" json:"created_at"`
	UpdatedAt              time.Time         `bun:"updated_at,type:timestamptz" json:"updated_at"`
	FailurePipelines       []FailurePipeline `bun:"type:jsonb,default:jsonb('[]')" json:"failure_pipelines"`
	FailurePipelineID      string            `bun:"failure_pipeline_id,type:text,default:''" json:"failure_pipeline_id"`
	FolderID               string            `bun:"folder_id,type:text,default:''" json:"folder_id"`
	ScheduleEveryValue     int               `bun:"schedule_every_value,type:integer,default:0" json:"schedule_every_value"`
	ScheduleEveryUnit      string            `bun:"schedule_every_unit,type:text,default:''" json:"schedule_every_unit"`
	Patterns               []Pattern         `bun:"type:jsonb,default:jsonb('[]')" json:"patterns"`
	GroupAlerts            bool              `bun:"group_alerts,type:bool,default:true" json:"group_alerts"`
	GroupAlertsIdentifier  string            `bun:"group_alerts_identifier,type:text,default:''" json:"group_alerts_identifier"`
	AlertThreshold         int               `bun:"alert_threshold,type:int,default:0" json:"alert_threshold"`
	AlwaysCleanupWorkspace bool              `bun:"always_cleanup_workspace,type:bool,default:false" json:"always_cleanup_workspace"`
}

type Folders

type Folders struct {
	bun.BaseModel `bun:"table:folders"`

	ID          uuid.UUID `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	Name        string    `bun:"name,type:text,notnull" json:"name"`
	Description string    `bun:"description,type:text,default:''" json:"description"`
	ParentID    string    `bun:"parent_id,type:text,default:''" json:"parent_id"`
	ProjectID   string    `bun:"project_id,type:text,default:''" json:"project_id"`
	CreatedAt   time.Time `bun:"created_at,type:timestamptz,default:now()" json:"created_at"`
}

type IncExpireTokenRequest

type IncExpireTokenRequest struct {
	ExpiresIn   int    `json:"expires_in"`
	Description string `json:"description"`
}

type IncomingAutoRunners

type IncomingAutoRunners struct {
	Registered    bool       `json:"registered"`
	Version       string     `json:"version"`
	Mode          string     `json:"mode"`
	LastHeartbeat time.Time  `json:"last_heartbeat"`
	Plugins       []Plugin   `json:"plugins"`
	Actions       []Action   `json:"actions"`
	Endpoints     []Endpoint `json:"endpoints"`
	ApiURL        string     `json:"api_url"`
	ApiToken      string     `json:"api_token"`
}

type IncomingGroupedAlertsRequest

type IncomingGroupedAlertsRequest struct {
	FlowID                string `json:"flow_id"`
	GroupAlertsIdentifier string `json:"group_alerts_identifier"`
}

type JWTClaim

type JWTClaim struct {
	ID   uuid.UUID `json:"id"`
	Type string    `json:"type"`
	jwt.RegisteredClaims
}

type JWTProjectClaim

type JWTProjectClaim struct {
	ProjectID string    `json:"project_id"`
	ID        uuid.UUID `json:"id"`
	Type      string    `json:"type"`
	jwt.RegisteredClaims
}

type JWTProjectRunnerClaim

type JWTProjectRunnerClaim struct {
	RunnerID  string    `json:"runner_id"`
	ProjectID string    `json:"project_id"`
	ID        uuid.UUID `json:"id"`
	Type      string    `json:"type"`
	jwt.RegisteredClaims
}

type Line

type Line struct {
	Content   string    `json:"content"`
	Color     string    `json:"color"`
	Timestamp time.Time `json:"timestamp"`
}

type Message

type Message struct {
	Title string `json:"title"`
	Lines []Line `json:"lines"`
}

type Notifications

type Notifications struct {
	bun.BaseModel `bun:"table:notifications"`

	ID         uuid.UUID `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	UserID     string    `bun:"user_id,type:text,notnull" json:"user_id"`
	Title      string    `bun:"title,type:text,notnull" json:"title"`
	Body       string    `bun:"body,type:text,default:''" json:"body"`
	IsRead     bool      `bun:"is_read,type:bool,default:false" json:"is_read"`
	IsArchived bool      `bun:"is_archived,type:bool,default:false" json:"is_archived"`
	Icon       string    `bun:"icon,type:text,default:''" json:"icon"`
	Color      string    `bun:"color,type:text,default:'primary'" json:"color"`
	Link       string    `bun:"link,type:text,default:''" json:"link"`
	LinkText   string    `bun:"link_text,type:text,default:''" json:"link_text"`
	CreatedAt  time.Time `bun:"created_at,type:timestamptz,default:now()" json:"created_at"`
}

type Option

type Option struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Params

type Params struct {
	Key         string    `json:"key"`
	Title       string    `json:"title"`
	Description string    `json:"description"`
	Category    string    `json:"category"`
	Required    bool      `json:"required"`
	Type        string    `json:"type"`
	Value       string    `json:"value"`
	Default     string    `json:"default"`
	Options     []Option  `json:"options,omitempty"`
	DependsOn   DependsOn `json:"depends_on,omitempty"`
}

type Pattern

type Pattern struct {
	Key   string `json:"key"`
	Value string `json:"value"`
	Type  string `json:"type"`
}

type PlanCountStats

type PlanCountStats struct {
	Plan  string `json:"plan"`
	Count int    `json:"count"`
}

type Plugin

type Plugin struct {
	Name     string   `json:"name"`
	Type     string   `json:"type"`
	Version  string   `json:"version"`
	Author   string   `json:"author"`
	Action   Action   `json:"action"`
	Endpoint Endpoint `json:"endpoint"`
}

type ProjectMembers

type ProjectMembers struct {
	bun.BaseModel `bun:"table:project_members"`

	ID             uuid.UUID `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	UserID         string    `bun:"user_id,type:text,notnull" json:"user_id"`
	ProjectID      string    `bun:"project_id,type:text,notnull" json:"project_id"`
	Role           string    `bun:"role,type:text,notnull" json:"role"`
	Disabled       bool      `bun:"disabled,type:bool,default:false" json:"disabled"`
	DisabledReason string    `bun:"disabled_reason,type:text,default:''" json:"disabled_reason"`
	InvitePending  bool      `bun:"invite_pending,type:bool,default:false" json:"invite_pending"`
	InvitedAt      time.Time `bun:"invited_at,type:timestamptz,default:now()" json:"invited_at"`
}

type ProjectMembersWithUserData

type ProjectMembersWithUserData struct {
	bun.BaseModel `bun:"table:project_members"`

	ID             uuid.UUID `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	UserID         string    `bun:"user_id,type:text,notnull" json:"user_id"`
	ProjectID      string    `bun:"project_id,type:text,notnull" json:"project_id"`
	Role           string    `bun:"role,type:text,notnull" json:"role"`
	Disabled       bool      `bun:"disabled,type:bool,default:false" json:"disabled"`
	DisabledReason string    `bun:"disabled_reason,type:text,default:''" json:"disabled_reason"`
	InvitePending  bool      `bun:"invite_pending,type:bool,default:false" json:"invite_pending"`
	InvitedAt      time.Time `bun:"invited_at,type:timestamptz,default:now()" json:"invited_at"`
	Username       string    `bun:"username,type:text" json:"username"`
	Email          string    `bun:"email,type:text" json:"email"`
}

type Projects

type Projects struct {
	bun.BaseModel `bun:"table:projects"`

	ID                    uuid.UUID `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	Name                  string    `bun:"name,type:text,notnull" json:"name"`
	Description           string    `bun:"description,type:text,default:''" json:"description"`
	SharedRunners         bool      `bun:"shared_runners,type:bool,default:false" json:"shared_runners"`
	Color                 string    `bun:"color,type:text,default:''" json:"color"`
	Icon                  string    `bun:"icon,type:text,default:''" json:"icon"`
	Disabled              bool      `bun:"disabled,type:bool,default:false" json:"disabled"`
	DisabledReason        string    `bun:"disabled_reason,type:text,default:''" json:"disabled_reason"`
	CreatedAt             time.Time `bun:"created_at,type:timestamptz,default:now()" json:"created_at"`
	EnableAutoRunners     bool      `bun:"enable_auto_runners,type:bool,default:false" json:"enable_auto_runners"`
	DisableRunnerJoin     bool      `bun:"disable_runner_join,type:bool,default:false" json:"disable_runner_join"`
	RunnerAutoJoinToken   string    `bun:"runner_auto_join_token,type:text,notnull" json:"runner_auto_join_token"`
	EncryptionKey         string    `bun:"encryption_key,type:text,default:''" json:"encryption_key"`
	EncryptionEnabled     bool      `bun:"encryption_enabled,type:bool,default:true" json:"encryption_enabled"`
	PredefinedFlowActions []Action  `bun:"predefined_flow_actions,type:jsonb,default:'[]'" json:"predefined_flow_actions"`
}

type ProjectsWithMembers

type ProjectsWithMembers struct {
	Projects
	Members []ProjectMembers `json:"members"`
}

type RoleCountStats

type RoleCountStats struct {
	Role  string `json:"role"`
	Count int    `json:"count"`
}

type Runners

type Runners struct {
	bun.BaseModel `bun:"table:runners"`

	ID                 uuid.UUID  `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	Name               string     `bun:"name,type:text,notnull" json:"name"`
	Registered         bool       `bun:"registered,type:bool,default:false" json:"registered"`
	ProjectID          string     `bun:"project_id,type:text,default:''" json:"project_id"`
	Version            string     `bun:"version,type:text,default:''" json:"version"`
	Mode               string     `bun:"mode,type:text,default:''" json:"mode"`
	AutoRunner         bool       `bun:"auto_runner,type:bool,default:false" json:"auto_runner"`
	SharedRunner       bool       `bun:"shared_runner,type:bool,default:false" json:"shared_runner"`
	LastHeartbeat      time.Time  `bun:"last_heartbeat,type:timestamptz" json:"last_heartbeat"`
	ExecutingJob       bool       `bun:"executing_job,type:bool,default:false" json:"executing_job"`
	Disabled           bool       `bun:"disabled,type:bool,default:false" json:"disabled"`
	DisabledReason     string     `bun:"disabled_reason,type:text,default:''" json:"disabled_reason"`
	Plugins            []Plugin   `bun:"plugins,type:jsonb,default:jsonb('[]')" json:"plugins"`
	Actions            []Action   `bun:"actions,type:jsonb,default:jsonb('[]')" json:"actions"`
	Endpoints          []Endpoint `bun:"endpoints,type:jsonb,default:jsonb('[]')" json:"endpoints"`
	RegisteredAt       time.Time  `bun:"registered_at,type:timestamptz,default:now()" json:"registered_at"`
	ExecutedExecutions []string   `bun:"executed_executions,type:text[],default:'{}'" json:"executed_executions"`
	ApiURL             string     `bun:"api_url,type:text,default:''" json:"api_url"`
	ApiToken           string     `bun:"api_token,type:text,default:''" json:"api_token"`
}

type Settings

type Settings struct {
	bun.BaseModel `bun:"table:settings"`

	ID                        int    `bun:"id,type:integer,pk,default:1" json:"id"`
	Maintenance               bool   `bun:"maintenance,type:bool,default:false" json:"maintenance"`
	SignUp                    bool   `bun:"signup,type:bool,default:true" json:"signup"`
	CreateProjects            bool   `bun:"create_projects,type:bool,default:true" json:"create_projects"`
	CreateFlows               bool   `bun:"create_flows,type:bool,default:true" json:"create_flows"`
	CreateRunners             bool   `bun:"create_runners,type:bool,default:true" json:"create_runners"`
	CreateApiKeys             bool   `bun:"create_api_keys,type:bool,default:true" json:"create_api_keys"`
	AddProjectMembers         bool   `bun:"add_project_members,type:bool,default:true" json:"add_project_members"`
	AddFlowActions            bool   `bun:"add_flow_actions,type:bool,default:true" json:"add_flow_actions"`
	StartExecutions           bool   `bun:"start_executions,type:bool,default:true" json:"start_executions"`
	AllowSharedRunnerAutoJoin bool   `bun:"allow_shared_runner_auto_join,type:bool,default:true" json:"allow_shared_runner_auto_join"`
	AllowSharedRunnerJoin     bool   `bun:"allow_shared_runner_join,type:bool,default:true" json:"allow_shared_runner_join"`
	SharedRunnerAutoJoinToken string `bun:"shared_runner_auto_join_token,type:text,default:''" json:"shared_runner_auto_join_token"`
	NewEncryptionMigrated     bool   `bun:"new_encryption_migrated,type:bool,default:false" json:"new_encryption_migrated"`
}

type Stats

type Stats struct {
	Key   string `json:"key"`
	Value int    `json:"value"`
}

type StatsExecutions

type StatsExecutions struct {
	Key        string `json:"key"`
	Executions int    `json:"executions"`
}

type StatsExecutionsTotals

type StatsExecutionsTotals struct {
	ExecutionCount int   `json:"total_executions"`
	ExecutionTrend Trend `json:"execution_trend"`
}

type SubAlerts

type SubAlerts struct {
	ID         string          `json:"id"`
	Name       string          `json:"name"`
	Status     string          `json:"status"`
	Labels     json.RawMessage `json:"labels"`
	StartedAt  time.Time       `json:"started_at"`
	ResolvedAt time.Time       `json:"resolved_at"`
}

type Tokens

type Tokens struct {
	bun.BaseModel `bun:"table:tokens"`

	ID             uuid.UUID `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	ProjectID      string    `bun:"project_id,type:text,default:''" json:"project_id"`
	Key            string    `bun:"key,type:text,notnull" json:"key"`
	Description    string    `bun:"description,type:text,default:''" json:"description"`
	Type           string    `bun:"type,type:text,notnull" json:"type"`
	Disabled       bool      `bun:"disabled,type:bool,default:false" json:"disabled"`
	DisabledReason string    `bun:"disabled_reason,type:text,default:''" json:"disabled_reason"`
	CreatedAt      time.Time `bun:"created_at,type:timestamptz,default:now()" json:"created_at"`
	ExpiresAt      time.Time `bun:"expires_at,type:timestamptz" json:"expires_at"`
	UserID         string    `bun:"user_id,type:text,default:''" json:"user_id"`
}

type Trend

type Trend struct {
	Direction  string  `json:"direction"`
	Percentage float64 `json:"percentage"`
}

type Users

type Users struct {
	bun.BaseModel `bun:"table:users"`

	ID             uuid.UUID `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	Username       string    `bun:"username,type:text,notnull" json:"username"`
	Email          string    `bun:"email,type:text,notnull" json:"email"`
	EmailVerified  bool      `bun:"email_verified,type:bool,default:false" json:"email_verified"`
	Welcomed       bool      `bun:"welcomed,type:bool,default:false" json:"welcomed"`
	Password       string    `bun:"password,type:text,notnull" json:"password"`
	Role           string    `bun:"role,type:text,notnull,default:'user'" json:"role"`
	Disabled       bool      `bun:"disabled,type:bool,default:false" json:"disabled"`
	DisabledReason string    `bun:"disabled_reason,type:text,default:''" json:"disabled_reason"`
	CreatedAt      time.Time `bun:"created_at,type:timestamptz,default:now()" json:"created_at"`
	UpdatedAt      time.Time `bun:"updated_at,type:timestamptz" json:"updated_at"`
}

func (*Users) CheckPassword

func (user *Users) CheckPassword(providedPassword string) error

func (*Users) HashPassword

func (user *Users) HashPassword(password string) error

Jump to

Keyboard shortcuts

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