models

package
v1.7.26 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricNameMemoryUsage  = "mem.used"
	MetricNameMemoryTotal  = "mem.total"
	MetricNameCpuUsage     = "cpu.used_pcnt"
	MetricNameGoRoutines   = "go.go_routines"
	MetricNameHeapObjects  = "go.heap_objects"
	MetricNameNumGC        = "go.num_gc"
	MetricNameGCPauseTotal = "go.gc_pause"
)

Variables

View Source
var ExtensionModelRegistrations []func(lit.Driver)

Functions

func Init

func Init(driver lit.Driver)

Types

type AcceptInvitationRequest

type AcceptInvitationRequest struct {
	Name     string `json:"name" binding:"required,min=1"`
	Password string `json:"password" binding:"required,min=8"`
}

type AiTrace

type AiTrace struct {
	Id              uuid.UUID         `json:"id" ch:"id"`
	ProjectId       uuid.UUID         `json:"projectId" ch:"project_id"`
	RecordedAt      time.Time         `json:"recordedAt" ch:"recorded_at"`
	Duration        time.Duration     `json:"duration" ch:"duration"`
	StatusCode      uint8             `json:"statusCode" ch:"status_code"`
	Model           string            `json:"model" ch:"model"`
	ResponseModel   string            `json:"responseModel" ch:"response_model"`
	Provider        string            `json:"provider" ch:"provider"`
	Operation       string            `json:"operation" ch:"operation"`
	InputTokens     int64             `json:"inputTokens" ch:"input_tokens"`
	OutputTokens    int64             `json:"outputTokens" ch:"output_tokens"`
	TotalTokens     int64             `json:"totalTokens" ch:"total_tokens"`
	CachedTokens    int64             `json:"cachedTokens" ch:"cached_tokens"`
	ReasoningTokens int64             `json:"reasoningTokens" ch:"reasoning_tokens"`
	InputCost       float64           `json:"inputCost" ch:"input_cost"`
	OutputCost      float64           `json:"outputCost" ch:"output_cost"`
	TotalCost       float64           `json:"totalCost" ch:"total_cost"`
	TraceName       string            `json:"traceName" ch:"trace_name"`
	UserId          string            `json:"userId" ch:"user_id"`
	FinishReason    string            `json:"finishReason" ch:"finish_reason"`
	ServerName      string            `json:"serverName" ch:"server_name"`
	AppVersion      string            `json:"appVersion" ch:"app_version"`
	StorageKey      string            `json:"storageKey" ch:"storage_key"`
	Attributes      map[string]string `json:"attributes" ch:"attributes"`
}

type AiTraceDetailStats

type AiTraceDetailStats struct {
	Count           int64   `json:"count"`
	AvgDuration     float64 `json:"avgDuration"`
	MedianDuration  float64 `json:"medianDuration"`
	P95Duration     float64 `json:"p95Duration"`
	TotalTokens     int64   `json:"totalTokens"`
	TotalCost       float64 `json:"totalCost"`
	AvgInputTokens  float64 `json:"avgInputTokens"`
	AvgOutputTokens float64 `json:"avgOutputTokens"`
	Throughput      float64 `json:"throughput"`
}

type AiTraceStats

type AiTraceStats struct {
	TraceName       string        `json:"traceName"`
	Count           uint64        `json:"count"`
	P50Duration     time.Duration `json:"p50Duration"`
	P95Duration     time.Duration `json:"p95Duration"`
	AvgDuration     time.Duration `json:"avgDuration"`
	TotalTokens     int64         `json:"totalTokens"`
	TotalCost       float64       `json:"totalCost"`
	AvgInputTokens  float64       `json:"avgInputTokens"`
	AvgOutputTokens float64       `json:"avgOutputTokens"`
	LastSeen        time.Time     `json:"lastSeen"`
}

type CountResult

type CountResult struct {
	Count int `lit:"count"`
}

type DashboardMetric

type DashboardMetric struct {
	ID        string                `json:"id"`
	Name      string                `json:"name"`
	Value     float64               `json:"value"`
	Unit      string                `json:"unit"`
	Trend     []DashboardTrendPoint `json:"trend"`
	Servers   []ServerMetricTrend   `json:"servers,omitempty"`
	Change24h float64               `json:"change24h"`
	Status    string                `json:"status"`
}

type DashboardResponse

type DashboardResponse struct {
	Metrics          []DashboardMetric `json:"metrics"`
	AvailableServers []string          `json:"availableServers"`
	LastUpdated      time.Time         `json:"lastUpdated"`
}

type DashboardTrendPoint

type DashboardTrendPoint struct {
	Timestamp time.Time `json:"timestamp"`
	Value     float64   `json:"value"`
}

type DiscoveredMetric

type DiscoveredMetric struct {
	Name       string   `json:"name"`
	TagKeys    []string `json:"tagKeys"`
	MetricType string   `json:"metricType,omitempty"`
	Unit       string   `json:"unit,omitempty"`
}

type Endpoint

type Endpoint struct {
	Id        uuid.UUID `json:"id" ch:"id"`
	ProjectId uuid.UUID `json:"projectId" ch:"project_id"`
	// endpoint is the route from the router/does not contain actual params so it's safe to group on it
	Endpoint           string            `json:"endpoint" ch:"endpoint"`
	Duration           time.Duration     `json:"duration" ch:"duration"`
	RecordedAt         time.Time         `json:"recordedAt" ch:"recorded_at"`
	StatusCode         int16             `json:"statusCode" ch:"status_code"`
	BodySize           int32             `json:"bodySize" ch:"body_size"`
	ClientIP           string            `json:"clientIP" ch:"client_ip"`
	Attributes         map[string]string `json:"attributes" ch:"attributes"`
	AppVersion         string            `json:"appVersion" ch:"app_version"`
	ServerName         string            `json:"serverName" ch:"server_name"`
	DistributedTraceId *uuid.UUID        `json:"distributedTraceId,omitempty" ch:"distributed_trace_id"`
	SpanId             *uuid.UUID        `json:"spanId,omitempty" ch:"span_id"`
	IsStream           bool              `json:"isStream" ch:"is_stream"`
}

type EndpointDetailStats

type EndpointDetailStats struct {
	Count          int64   `json:"count"`
	AvgDuration    float64 `json:"avgDuration"`    // in ms
	MedianDuration float64 `json:"medianDuration"` // in ms
	P95Duration    float64 `json:"p95Duration"`    // in ms
	P99Duration    float64 `json:"p99Duration"`    // in ms
	Apdex          float64 `json:"apdex"`          // 0-1 score
	ErrorRate      float64 `json:"errorRate"`      // percentage
	Throughput     float64 `json:"throughput"`     // requests per minute
	IsStream       bool    `json:"isStream"`       // true => latency/Apdex are not meaningful for this endpoint
}

EndpointDetailStats contains detailed statistics for a specific endpoint

type EndpointStackedChartResponse

type EndpointStackedChartResponse struct {
	Endpoints []string                  `json:"endpoints"` // Top 5 + "Other"
	Series    []EndpointTimeSeriesPoint `json:"series"`
}

EndpointStackedChartResponse contains the data for rendering a stacked area chart

type EndpointStats

type EndpointStats struct {
	Endpoint     string        `json:"endpoint"`
	Count        uint64        `json:"count"`
	P50Duration  time.Duration `json:"p50Duration"`
	P95Duration  time.Duration `json:"p95Duration"`
	P99Duration  time.Duration `json:"p99Duration"`
	AvgDuration  time.Duration `json:"avgDuration"`
	LastSeen     time.Time     `json:"lastSeen"`
	Impact       float64       `json:"impact"`       // 0-1 impact score
	ImpactReason string        `json:"impactReason"` // human-readable explanation of the dominant impact factor
	IsStream     bool          `json:"isStream"`     // true => latency/Apdex/impact intentionally zero
}

type EndpointTimeSeriesPoint

type EndpointTimeSeriesPoint struct {
	Timestamp time.Time `json:"timestamp"`
	Endpoint  string    `json:"endpoint"`
	Value     float64   `json:"value"`
}

EndpointTimeSeriesPoint represents a single data point in a time series for endpoint charts

type ExceptionGroup

type ExceptionGroup struct {
	ExceptionHash string                `json:"exceptionHash" ch:"exception_hash"`
	StackTrace    string                `json:"stackTrace" ch:"stack_trace"`
	LastSeen      time.Time             `json:"lastSeen" ch:"last_seen"`
	FirstSeen     time.Time             `json:"firstSeen" ch:"first_seen"`
	Count         uint64                `json:"count" ch:"count"`
	HourlyTrend   []ExceptionTrendPoint `json:"hourlyTrend,omitempty"`
}

type ExceptionStackTrace

type ExceptionStackTrace struct {
	Id                 uuid.UUID         `json:"id" ch:"id"`
	ProjectId          uuid.UUID         `json:"projectId" ch:"project_id"`
	TraceId            *uuid.UUID        `json:"traceId" ch:"trace_id"`
	TraceType          string            `json:"traceType" ch:"trace_type"` // "endpoint" or "task"
	ExceptionHash      string            `json:"exceptionHash" ch:"exception_hash"`
	StackTrace         string            `json:"stackTrace" ch:"stack_trace"`
	RecordedAt         time.Time         `json:"recordedAt" ch:"recorded_at"`
	Attributes         map[string]string `json:"attributes" ch:"attributes"`
	AppVersion         string            `json:"appVersion" ch:"app_version"`
	ServerName         string            `json:"serverName" ch:"server_name"`
	IsMessage          bool              `json:"isMessage" ch:"is_message"`
	DistributedTraceId *uuid.UUID        `json:"distributedTraceId,omitempty" ch:"distributed_trace_id"`
	SessionId          *uuid.UUID        `json:"sessionId,omitempty" ch:"session_id"`
}

type ExceptionTrendPoint

type ExceptionTrendPoint struct {
	Timestamp time.Time `json:"timestamp"`
	Count     uint64    `json:"count"`
}

type ForgotPasswordRequest

type ForgotPasswordRequest struct {
	Email string `json:"email" binding:"required,email"`
}

type Invitation

type Invitation struct {
	Id             int        `json:"id"`
	OrganizationId int        `json:"organizationId"`
	Email          string     `json:"email"`
	Role           string     `json:"role"`
	Token          string     `json:"-"`
	InvitedBy      int        `json:"invitedBy"`
	Status         string     `json:"status"`
	ExpiresAt      time.Time  `json:"expiresAt"`
	AcceptedAt     *time.Time `json:"acceptedAt,omitempty"`
	CreatedAt      time.Time  `json:"createdAt"`
}

type InvitationInfoResponse

type InvitationInfoResponse struct {
	Email            string `json:"email"`
	OrganizationName string `json:"organizationName"`
	InviterName      string `json:"inviterName"`
	ExistsAsUser     bool   `json:"existsAsUser"`
	Role             string `json:"role"`
}

type InvitationWithInviter

type InvitationWithInviter struct {
	Id             int        `json:"id"`
	OrganizationId int        `json:"organizationId"`
	Email          string     `json:"email"`
	Role           string     `json:"role"`
	InvitedBy      int        `json:"invitedBy"`
	InviterName    string     `json:"inviterName" lit:"inviter_name"`
	Status         string     `json:"status"`
	ExpiresAt      time.Time  `json:"expiresAt"`
	AcceptedAt     *time.Time `json:"acceptedAt,omitempty"`
	CreatedAt      time.Time  `json:"createdAt"`
}

type InviteUserRequest

type InviteUserRequest struct {
	Email string `json:"email" binding:"required,email"`
	Role  string `json:"role" binding:"required,oneof=admin user readonly"`
}

type LogRecord

type LogRecord struct {
	Id                 uuid.UUID         `json:"id" ch:"id"`
	ProjectId          uuid.UUID         `json:"projectId" ch:"project_id"`
	Timestamp          time.Time         `json:"timestamp" ch:"timestamp"`
	TraceId            string            `json:"traceId" ch:"trace_id"`
	SpanId             string            `json:"spanId" ch:"span_id"`
	TraceFlags         uint8             `json:"traceFlags" ch:"trace_flags"`
	SeverityText       string            `json:"severityText" ch:"severity_text"`
	SeverityNumber     uint8             `json:"severityNumber" ch:"severity_number"`
	ServiceName        string            `json:"serviceName" ch:"service_name"`
	Body               string            `json:"body" ch:"body"`
	ResourceSchemaUrl  string            `json:"resourceSchemaUrl" ch:"resource_schema_url"`
	ResourceAttributes map[string]string `json:"resourceAttributes" ch:"resource_attributes"`
	ScopeSchemaUrl     string            `json:"scopeSchemaUrl" ch:"scope_schema_url"`
	ScopeName          string            `json:"scopeName" ch:"scope_name"`
	ScopeVersion       string            `json:"scopeVersion" ch:"scope_version"`
	ScopeAttributes    map[string]string `json:"scopeAttributes" ch:"scope_attributes"`
	LogAttributes      map[string]string `json:"logAttributes" ch:"log_attributes"`
}

type LoginRequest

type LoginRequest struct {
	Email    string `json:"email" binding:"required,email"`
	Password string `json:"password" binding:"required"`
}

type LoginResponse

type LoginResponse struct {
	Token         string                      `json:"token"`
	User          UserResponse                `json:"user"`
	Projects      []*ProjectWithBackendUrl    `json:"projects"`
	Organizations []*UserOrganizationResponse `json:"organizations"`
}

type MetricPoint

type MetricPoint struct {
	ProjectId  uuid.UUID         `json:"projectId" ch:"project_id"`
	Name       string            `json:"name" ch:"name"`
	Value      float64           `json:"value" ch:"value"`
	Tags       map[string]string `json:"tags" ch:"tags"`
	RecordedAt time.Time         `json:"recordedAt" ch:"recorded_at"`
}

type MetricRegistry

type MetricRegistry struct {
	Id          int       `json:"id" lit:"id"`
	ProjectId   uuid.UUID `json:"projectId" lit:"project_id"`
	Name        string    `json:"name" lit:"name"`
	MetricType  string    `json:"metricType" lit:"metric_type"`
	Unit        string    `json:"unit" lit:"unit"`
	Description string    `json:"description" lit:"description"`
	CreatedAt   time.Time `json:"createdAt" lit:"created_at"`
}

type NotificationChannel

type NotificationChannel struct {
	Id          int             `json:"id" lit:"id"`
	ProjectId   uuid.UUID       `json:"projectId" lit:"project_id"`
	Name        string          `json:"name" lit:"name"`
	ChannelType string          `json:"channelType" lit:"channel_type"`
	Config      json.RawMessage `json:"config" lit:"config"`
	Enabled     bool            `json:"enabled" lit:"enabled"`
	CreatedBy   *int            `json:"createdBy" lit:"created_by"`
	CreatedAt   time.Time       `json:"createdAt" lit:"created_at"`
	UpdatedAt   time.Time       `json:"updatedAt" lit:"updated_at"`
}

type NotificationHistory

type NotificationHistory struct {
	Id           int       `json:"id" lit:"id"`
	ProjectId    uuid.UUID `json:"projectId" lit:"project_id"`
	RuleId       *int      `json:"ruleId" lit:"rule_id"`
	ChannelId    *int      `json:"channelId" lit:"channel_id"`
	RuleType     string    `json:"ruleType" lit:"rule_type"`
	RuleName     string    `json:"ruleName" lit:"rule_name"`
	ChannelName  string    `json:"channelName" lit:"channel_name"`
	Severity     string    `json:"severity" lit:"severity"`
	Subject      string    `json:"subject" lit:"subject"`
	Body         string    `json:"body" lit:"body"`
	Status       string    `json:"status" lit:"status"`
	ErrorMessage *string   `json:"errorMessage" lit:"error_message"`
	URL          string    `json:"url" lit:"url"`
	CreatedAt    time.Time `json:"createdAt" lit:"created_at"`
}

type NotificationRule

type NotificationRule struct {
	Id              int             `json:"id" lit:"id"`
	ProjectId       uuid.UUID       `json:"projectId" lit:"project_id"`
	ChannelId       int             `json:"channelId" lit:"channel_id"`
	Name            string          `json:"name" lit:"name"`
	RuleType        string          `json:"ruleType" lit:"rule_type"`
	Config          json.RawMessage `json:"config" lit:"config"`
	Enabled         bool            `json:"enabled" lit:"enabled"`
	CooldownMinutes int             `json:"cooldownMinutes" lit:"cooldown_minutes"`
	Severity        string          `json:"severity" lit:"severity"`
	SnoozedUntil    *time.Time      `json:"snoozedUntil" lit:"snoozed_until"`
	CreatedBy       *int            `json:"createdBy" lit:"created_by"`
	CreatedAt       time.Time       `json:"createdAt" lit:"created_at"`
	UpdatedAt       time.Time       `json:"updatedAt" lit:"updated_at"`
}

type NotificationRuleWithChannel

type NotificationRuleWithChannel struct {
	Id              int             `json:"id" lit:"id"`
	ProjectId       uuid.UUID       `json:"projectId" lit:"project_id"`
	ChannelId       int             `json:"channelId" lit:"channel_id"`
	Name            string          `json:"name" lit:"name"`
	RuleType        string          `json:"ruleType" lit:"rule_type"`
	Config          json.RawMessage `json:"config" lit:"config"`
	Enabled         bool            `json:"enabled" lit:"enabled"`
	CooldownMinutes int             `json:"cooldownMinutes" lit:"cooldown_minutes"`
	Severity        string          `json:"severity" lit:"severity"`
	SnoozedUntil    *time.Time      `json:"snoozedUntil" lit:"snoozed_until"`
	CreatedBy       *int            `json:"createdBy" lit:"created_by"`
	CreatedAt       time.Time       `json:"createdAt" lit:"created_at"`
	UpdatedAt       time.Time       `json:"updatedAt" lit:"updated_at"`
	ChannelName     string          `json:"channelName" lit:"channel_name"`
	ChannelType     string          `json:"channelType" lit:"channel_type"`
}

type Organization

type Organization struct {
	Id        int       `json:"id"`
	Name      string    `json:"name"`
	Timezone  string    `json:"timezone"`
	CreatedAt time.Time `json:"createdAt"`
}

type OrganizationMember

type OrganizationMember struct {
	Id        int       `json:"id"`
	Email     string    `json:"email"`
	Name      string    `json:"name"`
	Role      string    `json:"role"`
	CreatedAt time.Time `json:"createdAt"`
}

OrganizationMember represents a user with their role in an organization

type OrganizationSettingsResponse

type OrganizationSettingsResponse struct {
	Organization *Organization            `json:"organization"`
	Members      []*OrganizationMember    `json:"members"`
	Invitations  []*InvitationWithInviter `json:"invitations"`
	UserRole     string                   `json:"userRole"`
}

OrganizationSettingsResponse is returned for the settings page

type OrganizationUser

type OrganizationUser struct {
	Id             int       `json:"id"`
	UserId         int       `json:"userId"`
	OrganizationId int       `json:"organizationId"`
	Role           string    `json:"role"` // owner, admin, user, readonly
	CreatedAt      time.Time `json:"createdAt"`
}

type PasswordResetTokenInfo

type PasswordResetTokenInfo struct {
	Valid bool   `json:"valid"`
	Email string `json:"email,omitempty"`
}

type Project

type Project struct {
	Id             uuid.UUID `json:"id"`
	Name           string    `json:"name"`
	Token          string    `json:"token"`
	Framework      string    `json:"framework"`
	OrganizationId *int      `json:"organizationId"`
	CreatedAt      time.Time `json:"createdAt"`
	SourceMapToken *string   `json:"sourceMapToken,omitempty"`
}

func (Project) ToProjectWithBackendUrl

func (p Project) ToProjectWithBackendUrl() *ProjectWithBackendUrl

type ProjectWithBackendUrl

type ProjectWithBackendUrl struct {
	Project
	BackendUrl string `json:"backendUrl"`
}

type RegisterRequest

type RegisterRequest struct {
	Email            string `json:"email" binding:"required,email"`
	Name             string `json:"name" binding:"required"`
	Password         string `json:"password" binding:"required,min=8"`
	OrganizationName string `json:"organizationName" binding:"required"`
	Timezone         string `json:"timezone" binding:"required"`
	ProjectName      string `json:"projectName" binding:"required"`
	Framework        string `json:"framework" binding:"required"`
	CaptchaToken     string `json:"captchaToken"`
}

type RegisterResponse

type RegisterResponse struct {
	Token         string                      `json:"token"`
	User          UserResponse                `json:"user"`
	Project       ProjectWithBackendUrl       `json:"project"`
	Projects      []*ProjectWithBackendUrl    `json:"projects"`
	Organizations []*UserOrganizationResponse `json:"organizations"`
}

type ResetPasswordRequest

type ResetPasswordRequest struct {
	Password string `json:"password" binding:"required,min=8"`
}

type ServerMetricTrend

type ServerMetricTrend struct {
	ServerName string                `json:"serverName"`
	Value      float64               `json:"value"`
	Trend      []DashboardTrendPoint `json:"trend"`
}

ServerMetricTrend represents trend data for a single server

type Session

type Session struct {
	Id                 uuid.UUID         `json:"id" ch:"id"`
	ProjectId          uuid.UUID         `json:"projectId" ch:"project_id"`
	StartedAt          time.Time         `json:"startedAt" ch:"started_at"`
	EndedAt            *time.Time        `json:"endedAt,omitempty" ch:"ended_at"`
	Duration           int64             `json:"duration" ch:"duration"`
	ClientIP           string            `json:"clientIP" ch:"client_ip"`
	Attributes         map[string]string `json:"attributes" ch:"attributes"`
	AppVersion         string            `json:"appVersion" ch:"app_version"`
	ServerName         string            `json:"serverName" ch:"server_name"`
	DistributedTraceId *uuid.UUID        `json:"distributedTraceId,omitempty" ch:"distributed_trace_id"`
}

type SessionRecording

type SessionRecording struct {
	Id           uuid.UUID  `json:"id" ch:"id"`
	ProjectId    uuid.UUID  `json:"projectId" ch:"project_id"`
	ExceptionId  uuid.UUID  `json:"exceptionId" ch:"exception_id"`
	SessionId    *uuid.UUID `json:"sessionId,omitempty" ch:"session_id"`
	SegmentIndex int32      `json:"segmentIndex" ch:"segment_index"`
	FilePath     string     `json:"filePath" ch:"file_path"`
	RecordedAt   time.Time  `json:"recordedAt" ch:"recorded_at"`
}

type SourceMap

type SourceMap struct {
	Id         int       `json:"id"`
	ProjectId  uuid.UUID `json:"projectId"`
	Version    string    `json:"version"`
	FileName   string    `json:"fileName"`
	StorageKey string    `json:"storageKey"`
	FileSize   int64     `json:"fileSize"`
	UploadedAt time.Time `json:"uploadedAt"`
}

type Span

type Span struct {
	Id           uuid.UUID     `json:"id" ch:"id"`
	TraceId      uuid.UUID     `json:"traceId" ch:"trace_id"`
	ProjectId    uuid.UUID     `json:"projectId" ch:"project_id"`
	Name         string        `json:"name" ch:"name"`
	StartTime    time.Time     `json:"startTime" ch:"start_time"`
	Duration     time.Duration `json:"duration" ch:"duration"`
	RecordedAt   time.Time     `json:"recordedAt" ch:"recorded_at"`
	ParentSpanId *uuid.UUID    `json:"parentSpanId,omitempty" ch:"parent_span_id"`
}

type Task

type Task struct {
	Id                 uuid.UUID         `json:"id" ch:"id"`
	ProjectId          uuid.UUID         `json:"projectId" ch:"project_id"`
	TaskName           string            `json:"taskName" ch:"task_name"`
	Duration           time.Duration     `json:"duration" ch:"duration"`
	RecordedAt         time.Time         `json:"recordedAt" ch:"recorded_at"`
	ClientIP           string            `json:"clientIP" ch:"client_ip"`
	Attributes         map[string]string `json:"attributes" ch:"attributes"`
	AppVersion         string            `json:"appVersion" ch:"app_version"`
	ServerName         string            `json:"serverName" ch:"server_name"`
	DistributedTraceId *uuid.UUID        `json:"distributedTraceId,omitempty" ch:"distributed_trace_id"`
	SpanId             *uuid.UUID        `json:"spanId,omitempty" ch:"span_id"`
}

type TaskDetailStats

type TaskDetailStats struct {
	Count          int64   `json:"count"`
	AvgDuration    float64 `json:"avgDuration"`    // in ms
	MedianDuration float64 `json:"medianDuration"` // in ms
	P95Duration    float64 `json:"p95Duration"`    // in ms
	P99Duration    float64 `json:"p99Duration"`    // in ms
	Throughput     float64 `json:"throughput"`     // tasks per minute
}

TaskDetailStats contains detailed statistics for a specific task

type TaskStats

type TaskStats struct {
	TaskName    string        `json:"taskName"`
	Count       uint64        `json:"count"`
	P50Duration time.Duration `json:"p50Duration"`
	P95Duration time.Duration `json:"p95Duration"`
	AvgDuration time.Duration `json:"avgDuration"`
	LastSeen    time.Time     `json:"lastSeen"`
}

type TimeSeriesPoint

type TimeSeriesPoint struct {
	Timestamp time.Time
	Value     float64
}

TimeSeriesPoint is used internally for querying time-bucketed data

type UpdateMemberRoleRequest

type UpdateMemberRoleRequest struct {
	Role string `json:"role" binding:"required,oneof=admin user readonly"`
}

UpdateMemberRoleRequest is the request body for updating a member's role

type User

type User struct {
	Id                       int        `json:"id"`
	Email                    string     `json:"email"`
	Name                     string     `json:"name"`
	Password                 string     `json:"-"`
	CreatedAt                time.Time  `json:"createdAt"`
	PasswordResetToken       *string    `json:"-"`
	PasswordResetExpiresAt   *time.Time `json:"-"`
	PasswordResetRequestedAt *time.Time `json:"-"`
	OauthProvider            *string    `json:"-"`
	OauthUserId              *string    `json:"-"`
	AvatarUrl                *string    `json:"avatarUrl,omitempty"`
}

func (*User) ToResponse

func (u *User) ToResponse() UserResponse

type UserOrganizationResponse

type UserOrganizationResponse struct {
	Id       int    `json:"id"`
	Name     string `json:"name"`
	Role     string `json:"role"`
	Timezone string `json:"timezone"`
}

type UserResponse

type UserResponse struct {
	Id        int       `json:"id"`
	Email     string    `json:"email"`
	Name      string    `json:"name"`
	CreatedAt time.Time `json:"createdAt"`
}

type WidgetGroup

type WidgetGroup struct {
	Id          int       `json:"id" lit:"id"`
	ProjectId   uuid.UUID `json:"projectId" lit:"project_id"`
	Name        string    `json:"name" lit:"name"`
	Description string    `json:"description" lit:"description"`
	IsDefault   bool      `json:"isDefault" lit:"is_default"`
	CreatedBy   *int      `json:"createdBy" lit:"created_by"`
	CreatedAt   time.Time `json:"createdAt" lit:"created_at"`
	UpdatedAt   time.Time `json:"updatedAt" lit:"updated_at"`
}

type WidgetGroupWidget

type WidgetGroupWidget struct {
	Id            int             `json:"id" lit:"id"`
	WidgetGroupId int             `json:"widgetGroupId" lit:"widget_group_id"`
	Title         string          `json:"title" lit:"title"`
	WidgetType    string          `json:"widgetType" lit:"widget_type"`
	Config        json.RawMessage `json:"config" lit:"config"`
	Position      int             `json:"position" lit:"position"`
	IsStarred     bool            `json:"isStarred" lit:"is_starred"`
	CreatedAt     time.Time       `json:"createdAt" lit:"created_at"`
	UpdatedAt     time.Time       `json:"updatedAt" lit:"updated_at"`
}

type WidgetGroupWithWidgets

type WidgetGroupWithWidgets struct {
	WidgetGroup
	Widgets []WidgetGroupWidget `json:"widgets"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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